spring-framework / org.springframework.jms.connection / ConnectionFactoryUtils / getTransactionalSession

getTransactionalSession

@Nullable open static fun getTransactionalSession(cf: ConnectionFactory, @Nullable existingCon: Connection, synchedLocalTransactionAllowed: Boolean): Session

Obtain a JMS Session that is synchronized with the current transaction, if any.

Parameters

cf - the ConnectionFactory to obtain a Session for

existingCon - the existing JMS Connection to obtain a Session for (may be null)

synchedLocalTransactionAllowed - whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers.

Exceptions

JMSException - in case of JMS failure

Return
the transactional Session, or null if none found