public static TransactionException errorBindingToExternalTransaction(Exception internalException) { Object[] args = { }; TransactionException ex = new TransactionException(ExceptionMessageGenerator.buildMessage(TransactionException.class, ERROR_BINDING_TO_TRANSACTION, args)); ex.setErrorCode(ERROR_BINDING_TO_TRANSACTION); ex.setInternalException(internalException); return ex; }
protected void throwCheckTransactionFailedException() { throw new TransactionRequiredException(TransactionException.externalTransactionNotActive().getMessage()); }
public static TransactionException internalProxyException(Exception ex1) { Object[] args = { }; TransactionException ex = new TransactionException(ExceptionMessageGenerator.buildMessage(TransactionException.class, EXCEPTION_IN_PROXY_EXECUTION, args), ex1); ex.setErrorCode(EXCEPTION_IN_PROXY_EXECUTION); return ex; }
throw TransactionException.externalTransactionNotActive(); registerSynchronization_impl(listener, transaction); } catch (Exception exception) { throw TransactionException.errorBindingToExternalTransaction(exception);
/** * INTERNAL: * Return the transaction status. This may be any type of status or value, * depending upon the transaction system. */ public Object getTransactionStatus() { try { return getTransactionStatus_impl(); } catch (Exception exception) { throw TransactionException.errorGettingExternalTransactionStatus(exception); } }
/** * INTERNAL: * Return the active external transaction object, or null if * none is active. This may be in whatever form the transaction system uses. */ public Object getTransaction() { try { return getTransaction_impl(); } catch (Exception exception) { throw TransactionException.errorGettingExternalTransaction(exception); } }
/** * INTERNAL: * Mark the external transaction for rollback. */ public void markTransactionForRollback() { try { markTransactionForRollback_impl(); } catch (Exception exception) { throw TransactionException.errorMarkingTransactionForRollback(exception); } }
/** * PUBLIC: * Return a new controller for use with a JTA 1.0 compliant TransactionManager. */ public JTATransactionController() { super(); this.listenerFactory = new JTASynchronizationListener(); try { this.transactionManager = acquireTransactionManager(); } catch (Exception ex) { throw TransactionException.errorObtainingTransactionManager(ex); } }
/** * INTERNAL: * Commit the external transaction. * * @param session The session for which the transaction is being committed. */ public void commitTransaction(AbstractSession session) { try { Object status = getTransactionStatus(); logTxStateTrace(session, "TX_commit", status); if (canCommitTransaction_impl(status)) { logTxTrace(session, "TX_committingTxn", null); session.setWasJTSTransactionInternallyStarted(false); commitTransaction_impl(); } } catch (Exception exception) { throw TransactionException.errorCommittingExternalTransaction(exception); } }
/** * INTERNAL: * Begin an external transaction. * * @param session The session for which the transaction is being begun. */ public void beginTransaction(AbstractSession session) { try { Object status = getTransactionStatus(); logTxStateTrace(session, "TX_begin", status); // Make sure that we are in a state that we can actually start // a transaction (e.g. ensure one is not already in progress) if (canBeginTransaction_impl(status)) { logTxTrace(session, "TX_beginningTxn", null); beginTransaction_impl(); session.setWasJTSTransactionInternallyStarted(true); } } catch (Exception exception) { throw TransactionException.errorBeginningExternalTransaction(exception); } }
/** * INTERNAL: * Roll back the external transaction. * * @param session The session for which the transaction is being rolled back. */ public void rollbackTransaction(AbstractSession session) { try { Object status = getTransactionStatus(); logTxStateTrace(session, "TX_rollback", status); session.setWasJTSTransactionInternallyStarted(false); // Only roll back if there is a transaction to roll back if ((canRollbackTransaction_impl(status)) && (getTransaction() != null)) { logTxTrace(session, "TX_rollingBackTxn", null); rollbackTransaction_impl(); } } catch (Exception exception) { throw TransactionException.errorRollingBackExternalTransaction(exception); } }
throw new PersistenceException(TransactionException.errorBindingToExternalTransaction(e).getMessage(), e);
public static TransactionException externalTransactionNotActive() { Object[] args = { }; TransactionException ex = new TransactionException(ExceptionMessageGenerator.buildMessage(TransactionException.class, ERROR_NO_EXTERNAL_TRANSACTION_ACTIVE, args)); ex.setErrorCode(ERROR_NO_EXTERNAL_TRANSACTION_ACTIVE); return ex; }
throw TransactionException.externalTransactionNotActive(); registerSynchronization_impl(listener, transaction); } catch (Exception exception) { throw TransactionException.errorBindingToExternalTransaction(exception);
/** * INTERNAL: * Return the transaction status. This may be any type of status or value, * depending upon the transaction system. */ public Object getTransactionStatus() { try { return getTransactionStatus_impl(); } catch (Exception exception) { throw TransactionException.errorGettingExternalTransactionStatus(exception); } }
/** * INTERNAL: * Return the active external transaction object, or null if * none is active. This may be in whatever form the transaction system uses. */ public Object getTransaction() { try { return getTransaction_impl(); } catch (Exception exception) { throw TransactionException.errorGettingExternalTransaction(exception); } }
/** * INTERNAL: * Mark the external transaction for rollback. */ public void markTransactionForRollback() { try { markTransactionForRollback_impl(); } catch (Exception exception) { throw TransactionException.errorMarkingTransactionForRollback(exception); } }
/** * PUBLIC: * Return a new controller for use with a JTA 1.0 compliant TransactionManager. */ public JTATransactionController() { super(); this.listenerFactory = new JTASynchronizationListener(); try { this.transactionManager = acquireTransactionManager(); } catch (Exception ex) { throw TransactionException.errorObtainingTransactionManager(ex); } }
/** * INTERNAL: * Commit the external transaction. * * @param session The session for which the transaction is being committed. */ public void commitTransaction(AbstractSession session) { try { Object status = getTransactionStatus(); logTxStateTrace(session, "TX_commit", status); if (canCommitTransaction_impl(status)) { logTxTrace(session, "TX_committingTxn", null); session.setWasJTSTransactionInternallyStarted(false); commitTransaction_impl(); } } catch (Exception exception) { throw TransactionException.errorCommittingExternalTransaction(exception); } }
/** * INTERNAL: * Begin an external transaction. * * @param session The session for which the transaction is being begun. */ public void beginTransaction(AbstractSession session) { try { Object status = getTransactionStatus(); logTxStateTrace(session, "TX_begin", status); // Make sure that we are in a state that we can actually start // a transaction (e.g. ensure one is not already in progress) if (canBeginTransaction_impl(status)) { logTxTrace(session, "TX_beginningTxn", null); beginTransaction_impl(); session.setWasJTSTransactionInternallyStarted(true); } } catch (Exception exception) { throw TransactionException.errorBeginningExternalTransaction(exception); } }