Package javax.transaction

Examples of javax.transaction.TransactionManager.rollback()


                  }
                  mapPhaseKeys.add(key);
               }
               tm.commit();
            } catch (Exception e) {
               tm.rollback();
               throw new CacheException("Could not move intermediate keys/values for M/R task " + taskId, e);
            }
         }
      } else {
         // Combiner not specified so lets insert each key/uncombined-List pair into tmp cache
View Full Code Here


                  }
                  mapPhaseKeys.add(key);
               }
               tm.commit();
            } catch (Exception e) {
               tm.rollback();
               throw new CacheException("Could not move intermediate keys/values for M/R task " + taskId, e);
            }
         }
      }
      return mapPhaseKeys;
View Full Code Here

            tx.commit();
            log.debug("done commit");
         } catch (Exception ex) {
            try {
               log.debug("rollback... " + ex.getLocalizedMessage());
               tx.rollback();
               log.debug("done rollback");
            } catch (Exception rex) {
               log.debug("Exception rolling back", rex);
            }
         } finally {
View Full Code Here

   private static void clearRunningTx(Cache cache) {
      if (cache != null) {
         TransactionManager txm = TestingUtil.getTransactionManager(cache);
         if (txm == null) return;
         try {
            txm.rollback();
         }
         catch (Exception e) {
            // don't care
         }
      }
View Full Code Here

         try {
            if (c != null && c.getStatus() == ComponentStatus.RUNNING) {
               TransactionManager tm = getTransactionManager(c);
               if (tm != null) {
                  try {
                     tm.rollback();
                  }
                  catch (Exception e) {
                     // don't care
                  }
               }
View Full Code Here

      for (Cache c : caches) {
         if (c != null && c.getStatus() == ComponentStatus.RUNNING) {
            TransactionManager tm = getTransactionManager(c);
            if (tm != null) {
               try {
                  tm.rollback();
               }
               catch (Exception e) {
                  // don't care
               }
            }
View Full Code Here

         //expected
      }
      assertEquals(txTable.getLocalTxCount(), 2);

      //now the TM is expected to rollback the tx
      tm.rollback();
      assertEquals(txTable.getLocalTxCount(), 1);

      tm.resume(k1LockOwner);
      tm.commit();
View Full Code Here

      mgr.begin();
      cache1.put(key, "value3");
      assertEquals("value3", cache1.get(key));
      assertEquals("value2", cache2.get(key));

      mgr.rollback();

      assertEquals("value2", cache1.get(key));
      assertEquals("value2", cache2.get(key));

      assertNotLocked(cache1, key);
View Full Code Here

      String key = "key";
      TransactionManager mgr = TestingUtil.getTransactionManager(cache1);

      mgr.begin();
      cache1.put(key, "value3");
      mgr.rollback();

      assertNotLocked(cache1, key);

   }
}
View Full Code Here

      assert "v".equals(cache.get("k"));
      Transaction reader = tm.suspend();

      tm.begin();
      cache.put("k", "v2");
      tm.rollback();

      tm.resume(reader);
      Object value = cache.get("k");
      assert "v".equals(value) : "Expecting 'v' but was " + value;
      tm.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.