public TransactionId suspend() { return suspend(TimeUnit.MINUTES); }
public static TransactionId suspend() { TransactionId txId = ((TXManagerImpl)tm).suspend(); Log.getLogWriter().info("SUSPENDED TX: " + txId); return txId; }
public void testSuspendTimeout() throws Exception { cache.close(); System.setProperty("gemfire.suspendedTxTimeout", "1"); createCache(); TXManagerImpl mgr = (TXManagerImpl) cache.getCacheTransactionManager(); assertEquals(1, mgr.getSuspendedTransactionTimeout()); mgr.begin(); region.put("key", "value"); final TransactionId txId = mgr.suspend(); Thread.sleep(70*1000); try { mgr.resume(txId); fail("An expected exception was not thrown"); } catch (IllegalStateException expected) { } assertNull(region.get("key")); System.setProperty("gemfire.suspendedTxTimeout", ""); } }
assert this.dataPolicy != DataPolicy.REPLICATE; final TXManagerImpl txMgr = this.cache.getCacheTransactionManager(); TXId txId = txMgr.suspend(); try { boolean retry = true;
public Object getEntryForIterator(KeyInfo curr, LocalRegion currRgn, boolean rememberReads, boolean allowTombstones) { if (currRgn instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion)currRgn; if (!pr.getBucketPrimary(curr.getBucketId()).equals(pr.cache.getMyId())) { // to fix bug 47893 suspend the tx before calling nonTXGetEntry final TXManagerImpl txmgr = pr.getGemFireCache().getTXMgr(); TransactionId tid = txmgr.suspend(); try { return pr.nonTXGetEntry(curr, false, allowTombstones); } finally { txmgr.resume(tid); } } } if (! readEntryAndCheckIfDestroyed(curr, currRgn, rememberReads)) { // need to create KeyInfo since higher level iterator may reuse KeyInfo return new TXEntry(currRgn, new KeyInfo(curr.getKey(), curr.getCallbackArg(), curr.getBucketId()), proxy, rememberReads); } else { return null; } }