274275276277278279280281282283284
} 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
303304305306307308309310311312313
} 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;
128129130131132133134135136137138
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 {
647648649650651652653654655656657
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 } }
710711712713714715716717718719720
try { if (c != null && c.getStatus() == ComponentStatus.RUNNING) { TransactionManager tm = getTransactionManager(c); if (tm != null) { try { tm.rollback(); } catch (Exception e) { // don't care } }
756757758759760761762763764765766
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 } }
146147148149150151152153154155156
//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();
104105106107108109110111112113114
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);
122123124125126127128129130131132
String key = "key"; TransactionManager mgr = TestingUtil.getTransactionManager(cache1); mgr.begin(); cache1.put(key, "value3"); mgr.rollback(); assertNotLocked(cache1, key); } }
348349350351352353354355356357358
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();