A number of errors have crept into the DMLC Javadocs.
- setCachLevel() says that while the default is CACHE_NONE with an external txManager, it can be overridden. This is not the case because a new connection is obtained for each poll and bound to the thread.
- setTransactionManager refers to AMLC class Javadocs, which in turn imply that for downstream JmsTemplate within an @Transacted method needs the LC to have an external JmsTransactionManager.
In fact, even with sessionTransacted=true the session is bound to the thread via a LocallyExposedJmsResourceHolder and no external txManager is required and, if provided, precludes caching in the DMLC (CCF is needed).
It is now generally recommended that an external txManager only be provided if JTA is needed.
Suggest a thorough review of all Listener Container documentation regarding the use of JmsTransactionManager.