126127128129130131132133134135136
catch( Throwable ignore ) { log.trace( "unable to release connection on exception [" + ignore + "]" ); } if ( transacted ) { try { transactionManager.rollback(); } catch( Throwable ignore ) { log.trace( "unable to rollback new transaction on exception [" + ignore + "]" ); } }
470471472473474475476477478479480
// Commit or rollback depending on the status if (commit == false || transaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { if (trace) log.trace("MessageEndpoint " + getProxyString(proxy) + " rollback"); tm.rollback(); } else { if (trace) log.trace("MessageEndpoint " + getProxyString(proxy) + " commit");
151152153154155156157158159160161
166167168169170171172173174175176
{ session = runMyStatefulTest(); } finally { tm.rollback(); } try { session.remove(); fail("Should have thrown NoSuchEJBException");
9293949596979899100101102
cache.getNotifier().addCacheListener(new ExceptionListener()); TransactionManager tm = startTransaction(); try { cache.put(FQN_A, null); tm.rollback(); } catch (RuntimeException ex) { tm.rollback(); }
96979899100101102103104105106
cache.put(FQN_A, null); tm.rollback(); } catch (RuntimeException ex) { tm.rollback(); } assertFalse(cache.exists(FQN_A)); assertEquals(0, cache.getNumberOfLocksHeld()); }
119120121122123124125126127128129
{ if (tx2 != null) { try { mgr.rollback(); } catch (SystemException e) { e.printStackTrace(); }
173174175176177178179180181182183
TransactionManager mgr = cache1.getConfiguration().getRuntimeConfig().getTransactionManager(); mgr.begin(); cache1.put(fqn, "key1", "val1"); assertTrue(cache1.exists(fqn)); mgr.rollback(); assertFalse(cache1.getCacheLoaderManager().getCacheLoader().exists(fqn)); assertFalse(cache1.exists(fqn)); cache1.put("/a/b/c", null);// should be run outside a TX ! assertTrue(cache1.exists("/a/b/c")); }
141142143144145146147148149150151
mgr.begin(); cache1.put(fqn, key, "value3"); assertEquals("value3", cache1.get(fqn, key)); assertEquals("value2", cache2.get(fqn, key)); mgr.rollback(); assertEquals("value2", cache1.get(fqn, key)); assertEquals("value2", cache2.get(fqn, key)); }
6263646566676869707172
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); }