private void resumeTX(TXStateInterface state) { if (state != null) { TXManagerImpl txManager = state.getTxMgr(); txManager.resume(state); } }
public boolean tryResume(TransactionId transactionId) { if (transactionId == null || getTXState() != null) { return false; } TXStateProxy txProxy = this.suspendedTXs.remove(transactionId); if (txProxy != null) { resume(txProxy); return true; } return false; }
public boolean tryResume(TransactionId transactionId) { if (transactionId == null || getTXState() != null) { return false; } TXStateInterface tx = this.suspendedTXs.remove(transactionId); if (tx != null) { resume(tx); return true; } return false; }
private void resumeTX(TXStateProxy state) { if(state != null) { TXManagerImpl txManager = state.getTxMgr(); txManager.resume(state); } }
public static void internalResume(TXStateInterface txContext) { if (txContext != null) { Log.getLogWriter().fine("RESUMING TX: " + txContext.toString()); } ((TXManagerImpl)tm).resume(txContext); }
public static void resume(TransactionId txId) { Log.getLogWriter().info("RESUMING TX: " + txId); ((TXManagerImpl)tm).resume(txId); }
@Override public Object findObject(KeyInfo key, LocalRegion r, boolean isCreate, boolean generateCallbacks, Object value, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS) { TXStateProxy tx = r.cache.getTXMgr().internalSuspend(); try { return r.findObjectInSystem(key, isCreate, tx, generateCallbacks, value, disableCopyOnRead, preferCD, requestingClient, clientEvent, returnTombstones, allowReadFromHDFS); } finally { r.cache.getTXMgr().resume(tx); } }
@Override public Entry getEntry(KeyInfo keyInfo, LocalRegion localRegion, boolean allowTombstones) { TXStateProxy tx = localRegion.cache.getTXMgr().internalSuspend(); try { PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.nonTXGetEntry(keyInfo, false, allowTombstones); } finally { localRegion.cache.getTXMgr().resume(tx); } }
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.internalSuspend(); assertNotNull(tx); mgr.resume(tx); mgr.commit(); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.internalSuspend(); assertNotNull(tx); mgr.resume(tx); mgr.commit(); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.internalSuspend(); assertNotNull(tx); mgr.resume(tx); mgr.commit(); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.internalSuspend(); assertNotNull(tx); mgr.resume(tx); mgr.commit(); TXManagerImpl.waitForPendingCommitForTest(); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); Region<Object, Object> custRegion = getCache().getRegion(CUSTOMER); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); TXStateInterface tx = mgr.internalSuspend(); assertEquals(expectedCustomerUpdate, custRegion.get(expectedCustId)); mgr.resume(tx); mgr.commit(); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); custRegion.destroy(expectedCustId); assertNull(custRegion.get(expectedCustId)); return null; } });
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", ""); } }
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.internalSuspend(); assertNotNull(tx); mgr.resume(tx); if (commit) { mgr.commit(); TXManagerImpl.waitForPendingCommitForTest(); } else { mgr.rollback(); } return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); PartitionedRegion pr = (PartitionedRegion)getCache().getRegion(CUSTOMER); CustId keyOnDs = getKeyOnMember(pr.getMyId(), pr); mgr.begin(); pr.get(keyOnDs); Set filter = new HashSet(); filter.add(keyOnDs); FunctionService.onRegion(pr).withFilter(filter).execute(TXFunction.id).getResult(); assertEquals(expectedCustomer, pr.get(expectedCustId)); TXStateInterface tx = mgr.internalSuspend(); assertNull(pr.get(expectedCustId)); mgr.resume(tx); return null; } };
public Object call() throws Exception { Region<CustId, Customer> cust = getCache().getRegion(CUSTOMER); Region<CustId, Customer> ref = getCache().getRegion(D_REFERENCE); TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.begin(); Customer customer = new Customer("customer1", "address1"); Customer fakeCust = new Customer("foo", "bar"); assertFalse(cust.replace(custId, fakeCust, updatedCust)); assertTrue(cust.replace(custId, customer, updatedCust)); assertFalse(ref.replace(custId, fakeCust, updatedCust)); assertTrue(ref.replace(custId, customer, updatedCust)); TXStateInterface tx = mgr.internalSuspend(); assertEquals(cust.get(custId), customer); assertEquals(ref.get(custId), customer); mgr.resume(tx); return mgr.getTransactionId(); } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.begin(); Region cust = getCache().getRegion(CUSTOMER); Customer s = (Customer)cust.get(new CustId(8)); assertTrue(cust.containsKey(new CustId(8))); TXStateInterface tx = mgr.internalSuspend(); assertFalse(cust.containsKey(new CustId(8))); mgr.resume(tx); mgr.commit(); Customer s2 = (Customer)cust.get(new CustId(8)); Customer ex = new Customer("sup dawg", "add"); assertEquals(ex,s); assertEquals(ex,s2); return null; } });
public Object call() throws Exception { Region<Object, Object> custRegion = getCache().getRegion(CUSTOMER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXStateInterface tx = mgr.getHostedTXState(txId2); // force expected transaction TXStateInterface txOrig = mgr.getTXState(); mgr.setTXState(tx); tx = mgr.internalSuspend(); assertNull(custRegion.get(expectedCustId)); mgr.resume(tx); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); mgr.setTXState(txOrig); return null; } });
public Object call() throws Exception { Region custRegion = getCache().getRegion(CUSTOMER); TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.begin(); FunctionService.onRegion(custRegion).execute(TXFunction.id).getResult(); assertNotNull(mgr.getTXState()); TXStateInterface tx= mgr.internalSuspend(); assertNull(mgr.getTXState()); getGemfireCache().getLogger().fine("SWAP:callingget"); assertNull("expected null but was:" + custRegion.get(expectedCustId), custRegion.get(expectedCustId)); mgr.resume(tx); mgr.commit(); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); return null; } });