private void illegalStateTransition(String callName) throws XAException { XAException xae = newXAException("Cannot call " + callName + " now.", XAException.XAER_PROTO); throw xae; }
private void checkForPreparedState(boolean onePhase) throws XAException { if (!onePhase) { XAException xae = newXAException("Cannot do 2 phase commit if the transaction has not been prepared", XAException.XAER_PROTO); throw xae; } }
private void doPostRollback() throws XAException { try { fireAfterRollback(); } catch (Throwable e) { // I guess this could happen. Post commit task failed // to execute properly. LOG.warn("POST ROLLBACK FAILED: ", e); XAException xae = newXAException("POST ROLLBACK FAILED", XAException.XAER_RMERR); xae.initCause(e); throw xae; } }
private void doPrePrepare() throws XAException, IOException { try { prePrepare(); } catch (XAException e) { throw e; } catch (Throwable e) { LOG.warn("PRE-PREPARE FAILED: ", e); rollback(); XAException xae = newXAException("PRE-PREPARE FAILED: Transaction rolled back", XAException.XA_RBOTHER); xae.initCause(e); throw xae; } }
private void storeCommit(TransactionId txid, boolean wasPrepared, Runnable preCommit,Runnable postCommit) throws XAException, IOException { try { transactionStore.commit(getTransactionId(), wasPrepared, preCommitTask, postCommitTask); waitPostCommitDone(postCommitTask); } catch (XAException xae) { throw xae; } catch (Throwable t) { LOG.warn("Store COMMIT FAILED: " + txid, t); XAException xae = null; if (wasPrepared) { // report and await outcome xae = newXAException("STORE COMMIT FAILED: " + t.getMessage(), XAException.XA_RETRY); // fire rollback syncs to revert doPostRollback(); } else { try { rollback(); xae = newXAException("STORE COMMIT FAILED: Transaction rolled back", XAException.XA_RBCOMMFAIL); } catch (Throwable e) { xae = newXAException("STORE COMMIT FAILED: " + t.getMessage() +". Rolled failed:" + e.getMessage(), XAException.XA_RBINTEGRITY); } } xae.initCause(t); throw xae; } }
public Transaction getTransaction(ConnectionContext context, TransactionId xid, boolean mightBePrepared) throws JMSException, XAException { Transaction transaction = null; if (xid.isXATransaction()) { synchronized (xaTransactions) { transaction = xaTransactions.get(xid); } } else { transaction = context.getTransactions().get(xid); } if (transaction != null) { return transaction; } if (xid.isXATransaction()) { XAException e = XATransaction.newXAException("Transaction '" + xid + "' has not been started.", XAException.XAER_NOTA); throw e; } else { throw new JMSException("Transaction '" + xid + "' has not been started."); } }
break; default: throw newXAException("Invalid state: " + getState(), XAException.XA_RBPROTO);
private void checkForPreparedState(boolean onePhase) throws XAException { if (!onePhase) { XAException xae = newXAException("Cannot do 2 phase commit if the transaction has not been prepared", XAException.XAER_PROTO); throw xae; } }
private void checkForPreparedState(boolean onePhase) throws XAException { if (!onePhase) { XAException xae = newXAException("Cannot do 2 phase commit if the transaction has not been prepared", XAException.XAER_PROTO); throw xae; } }
private void illegalStateTransition(String callName) throws XAException { XAException xae = newXAException("Cannot call " + callName + " now.", XAException.XAER_PROTO); throw xae; }
private void illegalStateTransition(String callName) throws XAException { XAException xae = newXAException("Cannot call " + callName + " now.", XAException.XAER_PROTO); throw xae; }
private void checkForPreparedState(boolean onePhase) throws XAException { if (!onePhase) { XAException xae = newXAException("Cannot do 2 phase commit if the transaction has not been prepared", XAException.XAER_PROTO); throw xae; } }
private void illegalStateTransition(String callName) throws XAException { XAException xae = newXAException("Cannot call " + callName + " now.", XAException.XAER_PROTO); throw xae; }
private void doPostRollback() throws XAException { try { fireAfterRollback(); } catch (Throwable e) { // I guess this could happen. Post commit task failed // to execute properly. LOG.warn("POST ROLLBACK FAILED: ", e); XAException xae = newXAException("POST ROLLBACK FAILED", XAException.XAER_RMERR); xae.initCause(e); throw xae; } }
private void doPostRollback() throws XAException { try { fireAfterRollback(); } catch (Throwable e) { // I guess this could happen. Post commit task failed // to execute properly. LOG.warn("POST ROLLBACK FAILED: ", e); XAException xae = newXAException("POST ROLLBACK FAILED", XAException.XAER_RMERR); xae.initCause(e); throw xae; } }
private void doPostRollback() throws XAException { try { fireAfterRollback(); } catch (Throwable e) { // I guess this could happen. Post commit task failed // to execute properly. LOG.warn("POST ROLLBACK FAILED: ", e); XAException xae = newXAException("POST ROLLBACK FAILED", XAException.XAER_RMERR); xae.initCause(e); throw xae; } }
private void doPrePrepare() throws XAException, IOException { try { prePrepare(); } catch (XAException e) { throw e; } catch (Throwable e) { LOG.warn("PRE-PREPARE FAILED: ", e); rollback(); XAException xae = newXAException("PRE-PREPARE FAILED: Transaction rolled back", XAException.XA_RBOTHER); xae.initCause(e); throw xae; } }
private void doPrePrepare() throws XAException, IOException { try { prePrepare(); } catch (XAException e) { throw e; } catch (Throwable e) { LOG.warn("PRE-PREPARE FAILED: ", e); rollback(); XAException xae = newXAException("PRE-PREPARE FAILED: Transaction rolled back", XAException.XA_RBOTHER); xae.initCause(e); throw xae; } }
private void storeCommit(TransactionId txid, boolean wasPrepared, Runnable preCommit,Runnable postCommit) throws XAException, IOException { try { transactionStore.commit(getTransactionId(), wasPrepared, preCommitTask, postCommitTask); waitPostCommitDone(postCommitTask); } catch (XAException xae) { throw xae; } catch (Throwable t) { LOG.warn("Store COMMIT FAILED: ", t); rollback(); XAException xae = newXAException("STORE COMMIT FAILED: Transaction rolled back", XAException.XA_RBOTHER); xae.initCause(t); throw xae; } }
private void storeCommit(TransactionId txid, boolean wasPrepared, Runnable preCommit,Runnable postCommit) throws XAException, IOException { try { transactionStore.commit(getTransactionId(), wasPrepared, preCommitTask, postCommitTask); waitPostCommitDone(postCommitTask); } catch (XAException xae) { throw xae; } catch (Throwable t) { LOG.warn("Store COMMIT FAILED: ", t); rollback(); XAException xae = newXAException("STORE COMMIT FAILED: Transaction rolled back", XAException.XA_RBOTHER); xae.initCause(t); throw xae; } }