Search in sources :

Example 1 with TransactionRolledBackException

use of jakarta.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().getOriginalSession();
    if (session != null) {
        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(jakarta.jms.TransactionRolledBackException) JMSException(jakarta.jms.JMSException) TransactionSystemException(org.springframework.transaction.TransactionSystemException) Session(jakarta.jms.Session)

Aggregations

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