Examples of TransactionManager


Examples of org.apache.cayenne.tx.TransactionManager

     * operations.
     *
     * @since 3.2
     */
    public <T> T performInTransaction(TransactionalOperation<T> op) {
        TransactionManager tm = injector.getInstance(TransactionManager.class);
        return tm.performInTransaction(op);
    }
View Full Code Here

Examples of org.apache.derby.iapi.store.access.conglomerate.TransactionManager

    {

        // requeue if work was not completed in this try because of locks
        boolean             requeue_work = false;

        TransactionManager tc             = (TransactionManager)
            this.access_factory.getAndNameTransaction(
                contextMgr, AccessFactoryGlobals.SYS_TRANS_NAME);

        TransactionManager internal_xact  = tc.getInternalTransaction();

        if (SanityManager.DEBUG)
        {
            if (SanityManager.DEBUG_ON("verbose_btree_post_commit"))
                System.out.println("starting internal xact\n");
        }

        OpenBTree open_btree = null;

        try
        {
            // Get lock on base table.
           
            // First attempt to get a table lock on the btree.  This lock is
            // requested NOWAIT to not impede normal operation on the table.
            // If the lock were to wait then the current lock manager livelock
            // algorithm would block all subsequent lock requests on this
            // btree even if they are compatible with the current holder of
            // the lock.
            //
            // If this lock is granted then:
            // 1) deleted rows on the page can automatically be purged as
            //    they must be committed, otherwise lock would not have been
            //    granted.
            // 2) if all rows from page are reclaimed then a structure shrink
            //    which requires table level lock can be executed.
            //
            open_btree =
                openIndex(
                    internal_xact,
                    TransactionController.MODE_TABLE,
                    LockingPolicy.MODE_CONTAINER);

            DataValueDescriptor[] shrink_key =
                purgeCommittedDeletes(open_btree, this.page_number);

            // RESOLVE (mikem) - move this call when doing row level locking.
            if (shrink_key != null)
                doShrink(open_btree, shrink_key);

            open_btree.close();
        }
        catch (StandardException se)
        {
            // 2 kinds of errors here expected here.  Either container not
            // found or could not obtain lock (LOCK_TIMEOUT or DEADLOCK).
            //
            // It is possible by the time this post commit work gets scheduled
            // that the container has been dropped and that the open container
            // call will return null - in this case just return assuming no
            // work to be done.

      if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT) ||
        se.getMessageId().equals(SQLState.DEADLOCK))
      {
                // Could not get exclusive table lock, so try row level
                // reclaim of just the rows on this page.  No merge is
                // attempted.

                try
                {
                    open_btree =
                        openIndex(
                            internal_xact,
                            TransactionController.MODE_RECORD,
                            LockingPolicy.MODE_RECORD);

                    purgeRowLevelCommittedDeletes(open_btree);

                    open_btree.close();

                }
                catch (StandardException se2)
                {
                    if (se2.getMessageId().equals(SQLState.LOCK_TIMEOUT) ||
                        se2.getMessageId().equals(SQLState.DEADLOCK))
                    {
                        // Could not get intended exclusive table lock, so
                        // requeue and hope other user gives up table level
                        // lock soon.  This should not be normal case.
                        requeue_work = true;
                    }
                }
            }
        }
        finally
        {
            internal_xact.commit();
            internal_xact.destroy();
        }

        return(requeue_work ? Serviceable.REQUEUE : Serviceable.DONE);
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.transactional.TransactionManager

    desc.addFamily(new HColumnDescriptor(FAMILY));
    admin = new HBaseAdmin(conf);
    admin.createTable(desc);
    table = new TransactionalTable(conf, desc.getName());

    transactionManager = new TransactionManager(conf);
    writeInitalRows();
  }
View Full Code Here

Examples of org.apache.torque.util.TransactionManager

    {
        log.debug("initTransactionManager(" + conf + ")");

        String transactionManagerClassName =
                conf.getString(Torque.TRANSACTION_MANAGER_KEY);
        TransactionManager transactionManager;
        if (StringUtils.isEmpty(transactionManagerClassName))
        {
            if (log.isTraceEnabled())
            {
                log.trace("Configuration key " + Torque.TORQUE_KEY + "."
                    + Torque.TRANSACTION_MANAGER_KEY
                    + " not set, using default transaction manager "
                    + TransactionManagerImpl.class.getName());
            }
            transactionManager = new TransactionManagerImpl();
        }
        else
        {
            try
            {
                Class<?> transactionManagerClass
                        = Class.forName(transactionManagerClassName);
                transactionManager = (TransactionManager)
                        transactionManagerClass.newInstance();
                if (log.isTraceEnabled())
                {
                    log.trace("Using transaction manager "
                            + transactionManager.getClass().getName());
                }
            }
            catch (Exception e)
            {
                log.error("Error handling transaction manager configuration",
View Full Code Here

Examples of org.axonframework.unitofwork.TransactionManager

        }
        rescheduleOnCorruptState = configuration.getRescheduleCommandsOnCorruptState();
        invokerInterceptors = new ArrayList<CommandHandlerInterceptor>(configuration.getInvokerInterceptors());
        publisherInterceptors = new ArrayList<CommandHandlerInterceptor>(configuration.getPublisherInterceptors());
        dispatchInterceptors = new ArrayList<CommandDispatchInterceptor>(configuration.getDispatchInterceptors());
        TransactionManager transactionManager = configuration.getTransactionManager();
        disruptor = new Disruptor<CommandHandlingEntry>(
                new CommandHandlingEntry.Factory(configuration.getTransactionManager() != null),
                configuration.getBufferSize(),
                executor,
                configuration.getProducerType(),
View Full Code Here

Examples of org.castor.jdo.conf.TransactionManager

     * @param props Properties to be used for the transaction manager.
     * @return TransactionDemarcation configuration with global transaction handling.
     */
    public static TransactionDemarcation createGlobalTransactionDemarcation(
            final String name, final Properties props) {
        TransactionManager manager = new TransactionManager();
        manager.setName(name);

        Iterator iter = props.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry entry = (Map.Entry) iter.next();
            String key = (String) entry.getKey();
            String value = (String) entry.getValue();
           
            manager.addParam(createParam(key, value));
        }
       
        TransactionDemarcation trans = new TransactionDemarcation();
        trans.setMode("global");
        trans.setTransactionManager(manager);
View Full Code Here

Examples of org.cipango.server.transaction.TransactionManager

    if (_handler == null)
    {
      CallSessionHandler callSessionHandler = new CallSessionHandler();
      SipSessionHandler sipSessionHandler = new SipSessionHandler();
     
      TransactionManager transactionManager = ((Server) getServer()).getTransactionManager();
      callSessionHandler.setHandler(transactionManager);
     
      transactionManager.setHandler(sipSessionHandler);
     
      _handler = callSessionHandler;
    }

    _handler.setServer(getServer());
View Full Code Here

Examples of org.datanucleus.transaction.TransactionManager

    {
        if (txManager == null)
        {
            // Initialise support for transactions and register with JMX if running
            this.jmxManager = getJMXManager();
            txManager = new TransactionManager();
            if (jmxManager != null)
            {
                txManager.registerMbean(jmxManager.getDomainName(), jmxManager.getInstanceName(),
                    jmxManager.getManagementServer());
            }
View Full Code Here

Examples of org.drools.persistence.TransactionManager

        String testName = getTestName();
       
        // Setup the JtaTransactionmanager
        Environment env = createEnvironment(context);
        Object tm = env.get( EnvironmentName.TRANSACTION_MANAGER );
        TransactionManager txm = new JtaTransactionManager( env.get( EnvironmentName.TRANSACTION ),
                env.get( EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY ),
                tm );
          
        // Create linked transactionTestObjects
        TransactionTestObject mainObject = new TransactionTestObject();
        mainObject.setName("main" + testName);
        TransactionTestObject subObject = new TransactionTestObject();
        subObject.setName("sub" + testName);
        mainObject.setSubObject(subObject);
     
        // Commit the mainObject after "commiting" the subObject
        EntityManager em = emf.createEntityManager();
        try {
            // Begin the real trasnaction
            boolean txOwner = txm.begin();
     
            // Do the "sub" transaction
            // - the txm doesn't really commit,
            //   because we keep track of who's the tx owner.
            boolean notTxOwner = txm.begin();
            em.persist(mainObject);
            txm.commit(notTxOwner);
      
            // Finish the transaction off
            em.persist(subObject);
            txm.commit(txOwner);
        }
        catch( Throwable t ) {
            fail( "No exception should have been thrown: " + t.getMessage() );
        }
    }
View Full Code Here

Examples of org.exist.storage.txn.TransactionManager

 
    private void store(String name,  String data) throws EXistException {
      Database pool = BrokerPool.getInstance();;
     
        DBBroker broker = null;
        TransactionManager transact = null;
        Txn transaction = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
            transact = pool.getTransactionManager();
            assertNotNull(transact);
            transaction = transact.beginTransaction();
            assertNotNull(transaction);

            Collection root = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
        broker.saveCollection(transaction, root);
            assertNotNull(root);

            root.addBinaryResource(transaction, broker, XmldbURI.create(name), data.getBytes(), "application/xquery");

            transact.commit(transaction);
        } catch (Exception e) {
            if (transact != null)
                transact.abort(transaction);
            e.printStackTrace();
            fail(e.getMessage());
        } finally {
            pool.release(broker);
        }
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.