Search in sources :

Example 1 with TransactionRolledBackException

use of javax.jms.TransactionRolledBackException in project spring-framework by spring-projects.

the class JmsTransactionManager method doCommit.

@Override
protected void doCommit(DefaultTransactionStatus status) {
    JmsTransactionObject txObject = (JmsTransactionObject) status.getTransaction();
    Session session = txObject.getResourceHolder().getSession();
    try {
        if (status.isDebug()) {
            logger.debug("Committing JMS transaction on Session [" + session + "]");
        }
        session.commit();
    } catch (TransactionRolledBackException ex) {
        throw new UnexpectedRollbackException("JMS transaction rolled back", ex);
    } catch (JMSException ex) {
        throw new TransactionSystemException("Could not commit JMS transaction", ex);
    }
}
Also used : UnexpectedRollbackException(org.springframework.transaction.UnexpectedRollbackException) TransactionRolledBackException(javax.jms.TransactionRolledBackException) JMSException(javax.jms.JMSException) TransactionSystemException(org.springframework.transaction.TransactionSystemException) Session(javax.jms.Session)

Aggregations

JMSException (javax.jms.JMSException)1 Session (javax.jms.Session)1 TransactionRolledBackException (javax.jms.TransactionRolledBackException)1 TransactionSystemException (org.springframework.transaction.TransactionSystemException)1 UnexpectedRollbackException (org.springframework.transaction.UnexpectedRollbackException)1