Example usage for org.springframework.jms.connection ConnectionFactoryUtils isSessionTransactional

List of usage examples for org.springframework.jms.connection ConnectionFactoryUtils isSessionTransactional

Introduction

In this page you can find the example usage for org.springframework.jms.connection ConnectionFactoryUtils isSessionTransactional.

Prototype

public static boolean isSessionTransactional(@Nullable Session session, @Nullable ConnectionFactory cf) 

Source Link

Document

Determine whether the given JMS Session is transactional, that is, bound to the current thread by Spring's transaction facilities.

Usage

From source file:com.ccc.ccm.client.JMSTemplateAutowired.java

/**
* Check whether the given Session is locally transacted, that is, whether
* its transaction is managed by this listener container's Session handling
* and not by an external transaction coordinator.
* <p>Note: The Session's own transacted flag will already have been checked
* before. This method is about finding out whether the Session's transaction
* is local or externally coordinated./*  w  ww. ja  v  a 2  s.  c o m*/
* @param session the Session to check
* @return whether the given Session is locally transacted
* @see #isSessionTransacted()
* @see org.springframework.jms.connection.ConnectionFactoryUtils#isSessionTransactional
*/
protected boolean isSessionLocallyTransacted(Session session) {
    return isSessionTransacted()
            && !ConnectionFactoryUtils.isSessionTransactional(session, getConnectionFactory());
}