/** * Get the transaction entry for given transaction. Check if transaction is valid * * @return XtnEntry */ public XtnEntry getTransactionEntry(ServerTransaction txn) throws TransactionException { XtnEntry xtnEntry = m_XtnTable.get(txn); // check if this transaction is still active if (xtnEntry != null && !xtnEntry.isActive()) throw new TransactionException("Transaction is not active: " + txn.toString()); return xtnEntry; }
public DistributedTransactionManagerProvider() throws TransactionException { synchronized (_lock) { if (_transactionManager == null) { try { TxnManager impl = MahaloFactory.createMahalo(); _transactionManager = impl.getLocalProxy(); _txnManagerReferencesCount = 0; } catch (Exception e) { throw new TransactionException(e.getMessage(), e); } } _txnManagerReferencesCount++; } }
public void checkTransactionDisconnection(OperationID opid, ServerTransaction txn) throws TransactionException { XtnEntry xtnEntry = m_XtnTable.get(txn); Logger logger = CacheManager.getCacheLogger(); //Do no remove/change logger, using in unitTest see @PollingContainerTest if (logger.isLoggable(Level.FINER)) { if (!(_engine.getSpaceImpl().isBackup() || opid == null)) { logger.finer("DebugForTest:ThreadID:" + Thread.currentThread().getName() + "TransactionID= " + txn.id + " operationID={" + opid.toString() + "}"); } } if (xtnEntry == null || !xtnEntry.createdOnNonBackup() || opid == null || !xtnEntry.getXtnData().isOperationID(opid)) { return; } TransactionException exception = new TransactionException("Transaction was disconnected due to communication fault: " + txn.toString()); _engine.getLogger().log(Level.WARNING, "Transaction disconnection has been detected, Transaction will be aborted", exception); try{ _engine.abort(txn.getTransactionManager(), txn, false, opid); } catch (Exception e){ _engine.getLogger().log(Level.WARNING, "Failed to abort transaction "+txn.toString(), e); } addToPhantomGlobalXtns(txn); throw exception; }
public LookupDistributedTransactionManagerProvider(LookupTransactionManagerConfiguration config) throws TransactionException { try { LookupRequest request = LookupRequest.TransactionManager() .setServiceName(config.getLookupTransactionName()) .setLocators(config.getLookupTransactionLocators()) .setGroups(config.getLookupTransactionGroups()) .setTimeout(config.getLookupTransactionTimeout()); _transactionManager = (TransactionManager) LookupFinder.find(request); } catch (FinderException e) { throw new TransactionException(e.getMessage(), e); } }
throw new TransactionException("The transaction is not active: " + txnEntry.m_Transaction);
} catch (TransactionNotActiveException ex) { if (ex.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active : " + template.getXidOriginatedTransaction()); return null;
currentEh.getUID() + " Class=" + currentEh.getClassName(), entryInSpaceEx); } catch (EntryNotInSpaceException ex) { throw new TransactionException("Transaction [" + txnEntry.m_Transaction + "] became inactive while operation is performing.", ex); } catch (InterruptedException e) {
} catch (TransactionNotActiveException tnae) { if (template.getXidOriginatedTransaction() != null && tnae.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active " + tnae.m_Xtn, tnae);
} catch (TransactionNotActiveException ex) { if (ex.m_Xtn.equals(template.getXidOriginatedTransaction())) throw new TransactionException("Transaction not active : " + template.getXidOriginatedTransaction(), ex);
XtnEntry xtnEntry = entry.getXidOriginated(); if (xtnEntry == null || !xtnEntry.m_Active) throw new TransactionException("The transaction is not active: " + entry.getXidOriginatedTransaction());
try { if (!txnEntry.m_Active) throw new TransactionException("The transaction is not active: " + txnEntry.m_Transaction);
if (xtnEntry == null || !xtnEntry.m_Active) { context.setOperationAnswer(template, null, new TransactionException("The transaction is not active: " + template.getXidOriginatedTransaction())); return;
if (xtnEntry == null || !xtnEntry.m_Active) { context.setOperationAnswer(template, null, new TransactionException("The transaction is not active: " + template.getXidOriginatedTransaction())); return;
removeUnusedTransaction(xtnEntry, false /* needLock*/); xtnEntry = null; throw new TransactionException(" phantom xtn reached member=" + _engine.getFullSpaceName() + " xtnid=" + txn.id);
if (xtnEntry == null || !xtnEntry.m_Active) { context.setOperationAnswer(template, null, new TransactionException("The transaction is not active: " + template.getXidOriginatedTransaction())); return;
if (xtnEntry == null || !xtnEntry.m_Active) { context.setOperationAnswer(template, null, new TransactionException("The transaction is not active: " + template.getXidOriginatedTransaction())); return;
try {//lock xtn table if (!txnEntry.m_Active) throw new TransactionException("The transaction is not active: " + txnEntry.m_Transaction);
context.setOperationAnswer(template, null, null); else context.setOperationAnswer(template, null, new TransactionException("Transaction not active : " + xtnEntry.m_Transaction)); _cacheManager.removeTemplate(context, template, false /*fromReplication*/, true /*origin*/, false);