private void setIfTransactionDistributed() { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if (cache != null) { if (cache.getTxManager() != null) { this.isTransactionDistributed = cache.getTxManager().isDistributed(); } } } }
/** * @return the node which a transaction is already is progress, null otherwise */ private DistributedMember getTransactionalNode() { if (cache.getTxManager().getTXState() != null) { return cache.getTxManager().getTXState().getTarget(); } return null; }
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); assertTrue(mgr.isHostedTxInProgress(txId)); return null; } });
@Override public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); assertEquals(0, mgr.hostedTransactionsInProgressForTest()); return null; } };
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); return mgr.hostedTransactionsInProgressForTest(); } };
public Object call() throws Exception { getGemfireCache().getTxManager().setWriter(new TransactionWriter() { public void close() { } public void beforeCommit(TransactionEvent event) throws TransactionWriterException { throw new TransactionWriterException("TestException"); } }); return null; } });
public Object call() throws Exception { TestTxListener l = (TestTxListener)getGemfireCache().getTxManager().getListener(); assertTrue(l.isListenerInvoked()); return null; } });
public Object call() throws Exception { TestTxListener l = (TestTxListener)getGemfireCache().getTxManager() .getListener(); assertTrue(l.isListenerInvoked()); return null; } });
private void cleanupTransaction(final TXManagerImpl.TXContext context, final DistributionManager dm) { if (getTXId() != null) { final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if (cache == null) { // ignore and return, we are shutting down! return; } TXManagerImpl mgr = cache.getTxManager(); mgr.unmasquerade(context, true); } }
public Object call() throws Exception { getGemfireCache().getTxManager().addListener(new TestTxListener(false)); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.commit(); TXManagerImpl.waitForPendingCommitForTest(); return null; } });
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.commit(); TXManagerImpl.waitForPendingCommitForTest(); return null; } });
protected void clearTXStates() { // cleanup all pending TXRegionStates for (TXStateProxy txProxy : getCache().getTxManager() .getHostedTransactionsInProgress()) { txProxy.rmRegion(this); } }
public Object call() throws Exception { TXManagerImpl mgr = getGemfireCache().getTxManager(); assertFalse(mgr.isHostedTxInProgress(txId)); return null; } });
public Object call() throws Exception { Region custRegion = getCache().getRegion(CUSTOMER); CacheTransactionManager mgr = getGemfireCache().getTxManager(); mgr.commit(); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); custRegion.destroy(expectedCustId); return null; } };
public Object call() throws Exception { Region custRegion = getCache().getRegion(CUSTOMER); CacheTransactionManager mgr = getGemfireCache().getTxManager(); mgr.commit(); assertEquals(expectedCustomer, custRegion.get(expectedCustId)); custRegion.destroy(expectedCustId); 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 { Region cust = getCache().getRegion(CUSTOMER); TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.begin(); cust.put(new CustId(6), new Customer("customer6", "address6")); return null; } });
public Object call() throws Exception { Region<CustId, Customer> custRegion = getCache().getRegion(CUSTOMER); Region<OrderId, Order> orderRegion = getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); mgr.begin(); put10Entries(custRegion, orderRegion); return mgr.getTransactionId(); } });