Package javax.transaction

Examples of javax.transaction.TransactionManager.suspend()


      boolean caughtException = false;

      try {
        // First we need to suspend any current JTA transaction and obtain
        // a JDBC connection
        surroundingTransaction = transactionManager.suspend();
        if ( log.isDebugEnabled() ) {
          log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
        }

        if ( transacted ) {
View Full Code Here


      Transaction tx = null;

      try
      {
         toResume = mgr.suspend();

         conn = getConnectionFactory().createConnection();

         // Send a message
View Full Code Here

      mgr1.begin();
      cache1.put(fqn, "key2", "value2");
      Transaction tx1 = mgr1.suspend();
      mgr2.begin();
      cache2.put(fqn, "key3", "value3");
      Transaction tx2 = mgr2.suspend();
      mgr1.resume(tx1);
      // this oughtta fail
      try
      {
         mgr1.commit();
View Full Code Here

      mgr1.begin();
      cache1.put(fqn, "key2", "value2");
      Transaction tx1 = mgr1.suspend();
      mgr2.begin();
      cache2.put(fqn, "key3", "value3");
      Transaction tx2 = mgr2.suspend();
      mgr1.resume(tx1);
      // this oughtta fail
      try
      {
         mgr1.commit();
View Full Code Here

      mgr1.begin();
      cache1.put(fqn, "key2", "value2");
      Transaction tx1 = mgr1.suspend();
      mgr2.begin();
      cache2.put(fqn, "key3", "value3");
      Transaction tx2 = mgr2.suspend();
      mgr1.resume(tx1);
      // this oughtta fail
      try
      {
         mgr1.commit();
View Full Code Here

      // get a lock on cache 2 and hold on to it.
      TransactionManager tm = cache2.getConfiguration().getRuntimeConfig().getTransactionManager();
      tm.begin();
      cache2.put(fqn, "block", "block");
      Transaction t = tm.suspend();

      cache1.put(fqn, "k", "v");
   }
}
View Full Code Here

      Transaction tx = tm.getTransaction();
      Listener lis = new Listener();
      cache1.getNotifier().addCacheListener(lis);
      lis.put("/a/b/c", "age", 38);

      tm.suspend();
      assertNull("age on cache2 must be null as the TX has not yet been committed", cache2.get("/a/b/c", "age"));
      tm.resume(tx);
      tm.commit();

      // value on cache2 must be 38
View Full Code Here

      cache1.getNotifier().addCacheListener(lis);
      Map<String, Comparable> map = new HashMap<String, Comparable>();
      map.put("age", 38);
      map.put("name", "Ben");
      lis.put("/a/b/c", map);
      tm.suspend();
      assertNull("age on cache2 must be null as the TX has not yet been committed", cache2.get("/a/b/c", "age"));
      tm.resume(tx);
      tm.commit();

      // value on cache2 must be 38
View Full Code Here

      mgr.begin();
      assertEquals(value, cache.get(fqn, key));
      cache.removeNode(fqn);
      assertNull(cache.getNode(fqn));
      tx = mgr.getTransaction();
      mgr.suspend();

      mgr.begin();
      assertEquals(value, cache.get(fqn, key));
      mgr.commit();
View Full Code Here

      mgr.begin();
      cache.removeNode(fqn);
      assertNull(cache.getNode(fqn));
      tx = mgr.getTransaction();
      mgr.suspend();

      mgr.begin();
      assertEquals(value, cache.get(fqn, key));
      mgr.commit();
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.