Examples of serviceConnectionManager()


Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

      }

      PersistenceBrokerTransactionObject txObject = (PersistenceBrokerTransactionObject) transaction;
      txObject.setPersistenceBrokerHolder(new PersistenceBrokerHolder(pb));

      Connection con = pb.serviceConnectionManager().getConnection();
      Integer previousIsolationLevel = DataSourceUtils.prepareConnectionForTransaction(con, definition);
      txObject.setPreviousIsolationLevel(previousIsolationLevel);

      pb.beginTransaction();
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

      TransactionSynchronizationManager.unbindResource(getDataSource());
    }

    PersistenceBroker pb = txObject.getPersistenceBrokerHolder().getPersistenceBroker();
    try {
      Connection con = pb.serviceConnectionManager().getConnection();
      DataSourceUtils.resetConnectionAfterTransaction(con, txObject.getPreviousIsolationLevel());
    }
    catch (LookupException ex) {
      logger.info("Could not look up JDBC Connection of OJB PersistenceBroker", ex);
    }
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    final ConnectionManagerIF cm = (ConnectionManagerIF) cmControl.getMock();
    final Object entity = new Object();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    pb.serviceConnectionManager();
    pbControl.setReturnValue(cm, 2);
    cm.getConnection();
    cmControl.setReturnValue(con, 2);
    con.isReadOnly();
    conControl.setReturnValue(false, 1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    final ConnectionManagerIF cm = (ConnectionManagerIF) cmControl.getMock();
    final Object entity = new Object();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    pb.serviceConnectionManager();
    pbControl.setReturnValue(cm, 2);
    cm.getConnection();
    cmControl.setReturnValue(con, 2);
    con.setReadOnly(true);
    conControl.setVoidCallable(1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    final ConnectionManagerIF cm = (ConnectionManagerIF) cmControl.getMock();
    final Object entity = new Object();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    pb.serviceConnectionManager();
    pbControl.setReturnValue(cm, 2);
    cm.getConnection();
    cmControl.setReturnValue(con, 2);
    con.isReadOnly();
    conControl.setReturnValue(false, 1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    final ConnectionManagerIF cm = (ConnectionManagerIF) cmControl.getMock();
    final Object entity = new Object();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    pb.serviceConnectionManager();
    pbControl.setReturnValue(cm, 2);
    cm.getConnection();
    cmControl.setReturnValue(con, 2);
    con.isReadOnly();
    conControl.setReturnValue(false, 1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    cmControl.setReturnValue(con, 4);
    con.isReadOnly();
    conControl.setReturnValue(false, 2);
    pb1.beginTransaction();
    pb1Control.setVoidCallable(1);
    pb2.serviceConnectionManager();
    pb2Control.setReturnValue(cm, 2);
    pb2.beginTransaction();
    pb2Control.setVoidCallable(1);
    pb2.commitTransaction();
    pb2Control.setVoidCallable(1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

    final ConnectionManagerIF cm = (ConnectionManagerIF) cmControl.getMock();
    final Object entity = new Object();
    MockControl conControl = MockControl.createControl(Connection.class);
    Connection con = (Connection) conControl.getMock();

    pb.serviceConnectionManager();
    pbControl.setReturnValue(cm, 2);
    cm.getConnection();
    cmControl.setReturnValue(con, 2);
    con.isReadOnly();
    conControl.setReturnValue(false, 1);
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

            if(log.isDebugEnabled())
            {
                log.debug("Do internal cleanup and close the internal used connection without" +
                        " closing the used broker");
            }
            ConnectionManagerIF cm = broker.serviceConnectionManager();
            if(cm.isInLocalTransaction())
            {
                /*
                arminw:
                in managed environment this call will be ignored because, the JTA transaction
View Full Code Here

Examples of org.apache.ojb.broker.PersistenceBroker.serviceConnectionManager()

     * DB set <em>true</em>, else set <em>false</em> to improve performance.
     */
    public void writeObjects(boolean reuse) throws TransactionAbortedException, LockNotGrantedException
    {
        PersistenceBroker broker = transaction.getBroker();
        ConnectionManagerIF connMan = broker.serviceConnectionManager();
        boolean saveBatchMode = connMan.isBatchMode();

        try
        {
            if(log.isDebugEnabled())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.