Package javax.transaction

Examples of javax.transaction.TransactionManager.rollback()


      Transaction reader = tm.suspend();

      tm.begin();
      cache.put("k", "v");
      assert "v".equals(cache.get("k"));
      tm.rollback();

      tm.resume(reader);
      assert null == cache.get("k") : "Expecting null but was " + cache.get("k");
      tm.commit();
View Full Code Here


         c.put(key, "dummy"); // should time out
         assert false : "Should have been locked!";
      } catch (TimeoutException e) {
         // ignoring timeout exception
      } finally {
         tm.rollback();
      }
   }

   private void assertNotLocked(Cache<String, String> c, String key) throws SystemException, NotSupportedException {
      TransactionManager tm = TestingUtil.getTransactionManager(c);
View Full Code Here

      try {
         c.put(key, "dummy"); // should time out
      } catch (TimeoutException e) {
         assert false : "Should not have been locked!";
      } finally {
         tm.rollback();
      }
   }
}
View Full Code Here

       
        XAResource res3 = new MockXAResource("Oracle", "003");
        tm.getTransaction().enlistResource(res3);

        tm.getTransaction().delistResource(res3, XAResource.TMSUCCESS);
        tm.rollback();

        // Skip post
        // helper.managedGlobalTransactionPostInvoke(t2);

        helper.suspendsTransactionPostInvoke(suspended);
View Full Code Here

         TransactionManager txManager = txManager();
         txManager.resume(localTx.getTransaction());
         if (commit) {
            txManager.commit();
         } else {
            txManager.rollback();
         }
      }

      private void replayModificationsInTransaction(PrepareCommand command, boolean onePhaseCommit) throws Throwable {
         TransactionManager tm = txManager();
View Full Code Here

                  if( replaySuccessful ) {
                     log.tracef("Committing remotely originated tx %s as it is 1PC", command.getGlobalTransaction());
                     tm.commit();
                  } else {
                     log.tracef("Rolling back remotely originated tx %s", command.getGlobalTransaction());
                     tm.rollback();
                  }
               } else { // Wait for a remote commit/rollback.
                  remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction());
                  tm.suspend();
               }
View Full Code Here

         cache.endBatch(false);
      }
      TransactionManager tm = cache.getAdvancedCache().getTransactionManager();
      try {
         if (tm.getTransaction() != null) {
            tm.rollback();
         }
      } catch (Exception e) {
      }
   }
View Full Code Here

      TransactionManager tm = getTransactionManager(session);
      if (tm == null) {
         throw log.noTransactionManager();
      }
      try {
         tm.rollback();
         return EmptyResult.RESULT;
      } catch (Exception e) {
         throw log.cannotRollbackTransaction(e);
      }
   }
View Full Code Here

         case Status.STATUS_MARKED_ROLLBACK:
         case Status.STATUS_PREPARING:
         case Status.STATUS_ROLLING_BACK:
            try
            {
               tm.rollback();
            }
            catch (Exception ex)
            {
               log.error("Failed to rollback", ex);
            }
View Full Code Here

         case Status.STATUS_MARKED_ROLLBACK :
         case Status.STATUS_PREPARING :
         case Status.STATUS_ROLLING_BACK :
            try
            {
               tm.rollback();
            }
            catch (Exception sex)
            {
               log.error("Failed to rollback", sex);
            }
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.