Examples of TransactionManager


Examples of javax.transaction.TransactionManager

      {
         public void run()
         {
            try
            {
               TransactionManager tm = startTransaction();

               // Create an empty parent node and a node with data
               Fqn a1 = Fqn.fromRelativeElements(PARENT, "1");
               cache.put(a1, KEY, VALUE);

               // notify the second thread it can write
               secondCanWrite.countDown();

               // wait until the second thread writes and allows me to rollback or until I timeout
               firstCanRollback.await(3000, TimeUnit.MILLISECONDS);

               tm.rollback();

               assertNull("a1 empty", cache.get(a1, KEY));

               // notify the reading thread
               secondCanRead.countDown();
View Full Code Here

Examples of javax.transaction.TransactionManager

      }
   }

   private TransactionManager startTransaction() throws SystemException, NotSupportedException
   {
      TransactionManager mgr = cache.getTransactionManager();
      mgr.begin();
      return mgr;
   }
View Full Code Here

Examples of javax.transaction.TransactionManager

      {
         public void run()
         {
            try
            {
               TransactionManager tm = startTransaction();

               // change VALUE in a transaction
               cache.removeNode(FQN);

               // notify the reading thread
               readerCanRead.countDown();

               readerDone.await();

               tm.commit();
            }
            catch (AssertionError e)
            {
               writerError = e;
            }
View Full Code Here

Examples of javax.transaction.TransactionManager

   }

   private TransactionManager startTransaction() throws SystemException, NotSupportedException
   {
      TransactionManager mgr = cache.getTransactionManager();
      mgr.begin();
      return mgr;
   }
View Full Code Here

Examples of javax.transaction.TransactionManager

   }

   public void testFailure() throws Exception
   {

      TransactionManager tm = cache.getTransactionManager();
      try
      {
         tm.begin();
         cache.put("/a/b/c", "test", "test");
         assertTrue(cache.get("/a/b/c", "test").equals("test"));
         cache.removeNode("/a/b");
         assertTrue(!cache.exists("/a/b"));
         assertTrue(!cache.exists("/a/b/c"));
         cache.put("/a/b/d", "test1", "test1");
         assertTrue(!cache.exists("/a/b/c"));
         assertTrue(cache.exists("/a/b/d"));
         tm.commit();
         assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
         assertTrue(!cache.exists("/a/b/c"));
         assertTrue(cache.exists("/a/b/d"));
         dataContainer.printLockInfo();
      }
      catch (Exception ex) {
         tm.rollback();
         throw ex;
      }
      dataContainer.printLockInfo();
      try
      {
         tm.begin();
         Transaction t = tm.suspend();
         try
         {
            cache.putForExternalRead(Fqn.fromString("/a/b/c"), "test", "test");
         }
         catch (Exception ignore) {
            ignore.printStackTrace();
         }
         tm.resume(t);
         cache.put("/a/b/c", "test", "test");
         tm.commit();
      }
      catch (Exception ex) {
         tm.rollback();
         throw ex;
      }
   }
View Full Code Here

Examples of jdbm.recman.TransactionManager

        }

        String path = new File( this.wkDirPath, attributeType.getOid() ).getAbsolutePath();

        BaseRecordManager base = new BaseRecordManager( path );
        TransactionManager transactionManager = base.getTransactionManager();
        transactionManager.setMaximumTransactionsInLog( 2000 );

        int realCacheSize = Math.max( cacheSize, DEFAULT_INDEX_CACHE_SIZE );
        recMan = new CacheRecordManager( base, new MRU( realCacheSize ) );

        try
View Full Code Here

Examples of jifx.transactionManager.TransactionManager

    }
    try {
        if (configuration != null){
          TMInformation transactionManagerInformation = new TMInformation(trmName);
          transactionManagerInformation.make(configuration);
          TransactionManager tm =  new TransactionManager(jndi, transactionManagerInformation, this);
          new Thread(tm).start();
   
          AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
          nf.enableAttribute("TMState");
          this.addNotificationListener((NotificationListener) tm, nf, this);
View Full Code Here

Examples of net.hasor.db.transaction.TransactionManager

        DataSource dataSource = atDefine.getDataSource();
        Propagation propagation = atDefine.getPropagationStrategy().getStrategy(targetMethod);
        Isolation isolation = atDefine.getIsolationStrategy().getStrategy(targetMethod);
        TranOperations around = atDefine.getAround();
        //
        TransactionManager manager = Manager.getTransactionManager(dataSource);
        TransactionStatus tranStatus = null;
        try {
            tranStatus = manager.getTransaction(propagation, isolation);
            return around.execute(tranStatus, invocation);
        } catch (Throwable e) {
            if (tranStatus != null) {
                tranStatus.setRollbackOnly();
            }
            throw e;
        } finally {
            if (tranStatus != null && !tranStatus.isCompleted()) {
                manager.commit(tranStatus);
            }
        }
    }
View Full Code Here

Examples of net.jini.core.transaction.server.TransactionManager

    JiniServiceFactoryBean serviceFactory = new JiniServiceFactoryBean();
    serviceFactory.afterPropertiesSet();

    JiniTransactionManagerFactoryBean txFactory = new JiniTransactionManagerFactoryBean();
    txFactory.afterPropertiesSet();
    TransactionManager tm = (TransactionManager) txFactory.getObject();
    //assertNotNull(tm);
  }
View Full Code Here

Examples of net.sourceforge.peers.sip.transaction.TransactionManager

       
        dialogManager = new DialogManager(logger);
       
        //transaction
       
        transactionManager = new TransactionManager(logger);
       
        //transport
       
        transportManager = new TransportManager(transactionManager, config,
                logger);
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.