Examples of TransactionManager


Examples of co.cask.tephra.TransactionManager

    this.txMetricsCollector = txMetricsCollector;
  }

  @Override
  public TransactionManager get() {
    return new TransactionManager(conf, storageProvider.get(), txMetricsCollector);
  }
View Full Code Here

Examples of com.alu.e3.common.transaction.TransactionManager

public class TestTransactionManagement {

  @Test
  public void testTransactionInCurrentThread() throws Exception {
    ITransactionManager txMnger = new TransactionManager();
    assertNull(txMnger.getTransactionContext());

    // create, begin, commit, end
    ITransaction tx = txMnger.getNewTransaction();
    assertNotNull(tx);

    // Not transaction id until the transaction has begun
    assertNull(tx.getTransactionId());
    // Not transaction context until the transaction has begun
    assertNull(txMnger.getTransactionContext());


    tx.begin();
    assertNotNull (tx.getTransactionId());
    assertNotNull (txMnger.getTransactionContext().getTransactionId());
    assertEquals (txMnger.getTransactionContext().getTransactionId(), tx.getTransactionId());

    tx.commit();
    assertNotNull (tx.getTransactionId());
    assertNotNull (txMnger.getTransactionContext().getTransactionId());
    assertEquals (txMnger.getTransactionContext().getTransactionId(), tx.getTransactionId());

    tx.end();
    assertNull(tx.getTransactionId());
    assertNull(txMnger.getTransactionContext());

    // create, begin, rollback
    tx = txMnger.getNewTransaction();
    assertNull(tx.getTransactionId());
    assertNull(txMnger.getTransactionContext());

    tx.begin();
    assertNotNull (tx.getTransactionId());
    assertNotNull (txMnger.getTransactionContext().getTransactionId());
    assertEquals (txMnger.getTransactionContext().getTransactionId(), tx.getTransactionId());

    tx.rollback();
    assertNull(tx.getTransactionId());
    assertNull(txMnger.getTransactionContext());

    // begin, commit, rollback
    tx = txMnger.getNewTransaction();
    assertNull(tx.getTransactionId());
    assertNull(txMnger.getTransactionContext());

    tx.begin();
    assertNotNull (tx.getTransactionId());
    assertNotNull (txMnger.getTransactionContext().getTransactionId());
    assertEquals (txMnger.getTransactionContext().getTransactionId(), tx.getTransactionId());

    tx.commit();
    assertNotNull (tx.getTransactionId());
    assertNotNull (txMnger.getTransactionContext().getTransactionId());
    assertEquals (txMnger.getTransactionContext().getTransactionId(), tx.getTransactionId());

    tx.rollback();
    assertNull(tx.getTransactionId());
    assertNull(txMnger.getTransactionContext());
  }
View Full Code Here

Examples of com.arjuna.mw.wst.TransactionManager

    public static void testSingleParticipant()
            throws Exception
    {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
     
      ut.begin();
      try {
      tm.enlistForDurableTwoPhase(p, p.identifier());
        catch (Exception eouter) {
            try {
                ut.rollback();
            } catch(Exception einner) {
            }
View Full Code Here

Examples of com.arjuna.mw.wst11.TransactionManager

            // get the transaction ID associated with this thread
            transactionId = UserTransactionFactory.userTransaction().toString();

            // enlist the Participant for this service:
            RestaurantParticipant restaurantParticipant = new RestaurantParticipant(transactionId);
            TransactionManager transactionManager = TransactionManagerFactory.transactionManager();
            System.out.println("[SERVICE] Enlisting a Durable2PC participant into the AT");
            transactionManager.enlistForDurableTwoPhase(restaurantParticipant, "restaurantServiceAT:" + UUID.randomUUID());
        } catch (Exception e) {
            throw new RestaurantException("Error when enlisting participant", e);
        }

        // invoke the backend business logic:
View Full Code Here

Examples of com.arjuna.mw.wstx.TransactionManager

  {
      synchronized (_implementations)
      {
    org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
    String protocolType = child.getNodeValue();
    TransactionManager tx = (TransactionManager) _implementations.get(protocolType);

    if (tx == null)
    {
        Object implementation = _protocolManager.getProtocolImplementation(protocol);
View Full Code Here

Examples of com.avaje.ebeaninternal.server.transaction.TransactionManager

   
    if (isAutoCommitMode()) {
      return new AutoCommitTransactionManager(clusterManager, backgroundExecutor, serverConfig, beanDescriptorManager, this.getBootupClasses());
    }
   
    return new TransactionManager(clusterManager, backgroundExecutor, serverConfig, beanDescriptorManager, this.getBootupClasses());
  }
View Full Code Here

Examples of com.bekvon.bukkit.residence.economy.TransactionManager

            }
            if (leasemanager == null) {
                leasemanager = new LeaseManager(rmanager);
            }
            if (tmanager == null) {
                tmanager = new TransactionManager(rmanager, gmanager);
            }
            if (pmanager == null) {
                pmanager = new PermissionListManager();
            }
            if (firstenable) {
View Full Code Here

Examples of com.caucho.server.admin.TransactionManager

  public TransactionManager createTransactionManager()
    throws ConfigException
  {
    log.warning(L.l("<transaction-manager> tag belongs in <management>"));

    return new TransactionManager(_resin);
  }
View Full Code Here

Examples of com.hp.hpl.jena.tdb.transaction.TransactionManager

                    int z = change(dsg, id, i) ;
                    pause(maxpause) ;
                    int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
                    if ( x1+z != x2 )
                    {
                        TransactionManager txnMgr = dsg.getTransaction().getTxnMgr() ;
                        SysTxnState state = txnMgr.state() ;
                        String label = dsg.getTransaction().getLabel() ;
                        log.warn(format("WRITER: %s Change seen: %d + %d != %d : id=%d: i=%d", label, x1, z, x2, id, i)) ;
                        log.warn(state.toString()) ;
                        dsg.abort() ;
                        dsg.end() ;
View Full Code Here

Examples of com.ibatis.sqlmap.engine.transaction.TransactionManager


        String type = attributes.getProperty("type");
        type = vars.typeHandlerFactory.resolveAlias(type);

        TransactionManager txManager = null;
        try {
          vars.errorCtx.setMoreInfo("Check the transaction manager type or class.");
          TransactionConfig config = (TransactionConfig) Resources.instantiate(type);
          config.setDataSource(vars.dataSource);
          config.setMaximumConcurrentTransactions(vars.client.getDelegate().getMaxTransactions());
          vars.errorCtx.setMoreInfo("Check the transactio nmanager properties or configuration.");
          config.initialize(vars.txProps);
          vars.errorCtx.setMoreInfo(null);
          txManager = new TransactionManager(config);
          txManager.setForceCommit("true".equals(attributes.getProperty("commitRequired")));
        } catch (Exception e) {
          if (e instanceof SqlMapException) {
            throw (SqlMapException) e;
          } else {
            throw new SqlMapException("Error initializing TransactionManager.  Could not instantiate TransactionConfig.  Cause: " + e, e);
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.