private TXStateProxy prepForTransaction() throws InterruptedException { if (this.txUniqId == TXManagerImpl.NOTX) { return null; } else { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if(cache==null) { // ignore and return, we are shutting down! return null; } TXManagerImpl mgr = cache.getTXMgr(); return mgr.masqueradeAs(this); } }
private TXStateProxy prepForTransaction() throws InterruptedException { if (this.txUniqId == TXManagerImpl.NOTX) { return null; } else { GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if(cache==null) { // ignore and return, we are shutting down! return null; } TXManagerImpl mgr = cache.getTXMgr(); return mgr.masqueradeAs(this); } }
public final void resumeTransactionIfSuspended() { final TXStateInterface txSuspended = this.txStateSuspended; if (txSuspended != null) { this.txManager.masqueradeAs(txSuspended); setTXState(txSuspended); } this.isolationLevel = this.isolationSuspended; this.txStateSuspended = null; this.isolationSuspended = IsolationLevel.NONE; if (GemFireXDUtils.TraceTran && txSuspended != null) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_TRAN, "GemFireTransaction: resumeTransactionState: GemFire TX resumed: " + toString(), GemFireXDUtils.TraceTranVerbose ? new Throwable() : null); } }
public final void resumeTransactionIfSuspended() { final TXStateInterface txSuspended = this.txStateSuspended; if (txSuspended != null) { this.txManager.masqueradeAs(txSuspended); setTXState(txSuspended); } this.isolationLevel = this.isolationSuspended; this.txStateSuspended = null; this.isolationSuspended = IsolationLevel.NONE; if (GemFireXDUtils.TraceTran && txSuspended != null) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_TRAN, "GemFireTransaction: resumeTransactionState: GemFire TX resumed: " + toString(), GemFireXDUtils.TraceTranVerbose ? new Throwable() : null); } }
public final void resumeTransactionIfSuspended() { final TXStateInterface txSuspended = this.txStateSuspended; if (txSuspended != null) { this.txManager.masqueradeAs(txSuspended); setTXState(txSuspended); } this.isolationLevel = this.isolationSuspended; this.txStateSuspended = null; this.isolationSuspended = IsolationLevel.NONE; if (GemFireXDUtils.TraceTran && txSuspended != null) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_TRAN, "GemFireTransaction: resumeTransactionState: GemFire TX resumed: " + toString(), GemFireXDUtils.TraceTranVerbose ? new Throwable() : null); } }
private TXManagerImpl.TXContext prepForTransaction() { if (getTXId() == null) { return null; } else { final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if (cache == null) { // ignore and return, we are shutting down! return null; } TXManagerImpl mgr = cache.getTxManager(); return mgr.masqueradeAs(this, false, true); } }
private TXManagerImpl.TXContext prepForTransaction() { if (getTXId() == null) { return null; } else { final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); if (cache == null) { // ignore and return, we are shutting down! return null; } TXManagerImpl mgr = cache.getTxManager(); return mgr.masqueradeAs(this, false, true); } }
public void fireStatementTriggers(int triggerEvent, final LanguageConnectionContext lcc, final GemFireTransaction tran, final TXStateInterface tx) throws StandardException { // use proxy to enable distribution, if required (bug #43089) final TXStateProxy txProxy; if (tx != null && tx != (txProxy = tx.getProxy())) { final TXManagerImpl txMgr = tran.getTransactionManager(); txMgr.masqueradeAs(txProxy); tran.setActiveTXState(txProxy, false); try { invokeStatementTriggers(triggerEvent, lcc); // flush all batched ops due to triggers txProxy.flushPendingOps(null); } finally { txMgr.masqueradeAs(tx); tran.setActiveTXState(tx, false); } } else { invokeStatementTriggers(triggerEvent, lcc); } }
public void fireStatementTriggers(int triggerEvent, final LanguageConnectionContext lcc, final GemFireTransaction tran, final TXStateInterface tx) throws StandardException { // use proxy to enable distribution, if required (bug #43089) final TXStateProxy txProxy; if (tx != null && tx != (txProxy = tx.getProxy())) { final TXManagerImpl txMgr = tran.getTransactionManager(); txMgr.masqueradeAs(txProxy); tran.setActiveTXState(txProxy, false); try { invokeStatementTriggers(triggerEvent, lcc); // flush all batched ops due to triggers txProxy.flushPendingOps(null); } finally { txMgr.masqueradeAs(tx); tran.setActiveTXState(tx, false); } } else { invokeStatementTriggers(triggerEvent, lcc); } }
public void fireStatementTriggers(int triggerEvent, final LanguageConnectionContext lcc, final GemFireTransaction tran, final TXStateInterface tx) throws StandardException { // use proxy to enable distribution, if required (bug #43089) final TXStateProxy txProxy; if (tx != null && tx != (txProxy = tx.getProxy())) { final TXManagerImpl txMgr = tran.getTransactionManager(); txMgr.masqueradeAs(txProxy); tran.setActiveTXState(txProxy, false); try { invokeStatementTriggers(triggerEvent, lcc); // flush all batched ops due to triggers txProxy.flushPendingOps(null); } finally { txMgr.masqueradeAs(tx); tran.setActiveTXState(tx, false); } } else { invokeStatementTriggers(triggerEvent, lcc); } }
Throwable failureException = null; try { txState = txMgr.masqueradeAs(msg, member, false); if (isDebugEnabled) { logger.debug("Executing beforeCompletion() notification for transaction {}", msg.getTransactionId());
TXStateProxy txState = null; try { txState = txMgr.masqueradeAs(msg, member, false); int status = statusPart.getInt(); if (isDebugEnabled) {
txManager.masqueradeAs(txState); txManager.rollback(); } else if ((context = TXManagerImpl.currentTXContext()) != null) {
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId2).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
public Object call() throws Exception { LocalRegion custRegion = (LocalRegion)getCache().getRegion(CUSTOMER); LocalRegion orderRegion = (LocalRegion)getCache().getRegion(ORDER); TXManagerImpl mgr = getGemfireCache().getTxManager(); TXState txState = mgr.getHostedTXState(txId2).getLocalTXState(); final TXStateInterface currentTX = mgr.getTXState(); mgr.masqueradeAs(txState); for (int index = 0; index < 10; ++index) { final CustId custId = new CustId(index); assertEquals(new Customer("customer" + index, "address" + index), txState.getEntry(new KeyInfo(custId, null, null), custRegion, false, false).getValue()); assertEquals(new Order("order" + index), txState.getEntry( new KeyInfo(new OrderId(index, custId), null, null), orderRegion, false, false).getValue()); } mgr.masqueradeAs(currentTX); return null; } });
txManager.masqueradeAs(txState); txManager.commit(); } else {
if (getLockingPolicy() == LockingPolicy.SNAPSHOT) { txMgr = rgn.getCache().getTxManager(); context = txMgr.masqueradeAs(this, false, true); ev.setTXState(getTXState());
if (getLockingPolicy() == LockingPolicy.SNAPSHOT) { txMgr = rgn.getCache().getTxManager(); context = txMgr.masqueradeAs(this, false, true); ev.setTXState(getTXState());