Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-3890

DefaultMessageListenerContainer does not enlist the session in the spring transaction framework

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.5.1
    • Component/s: JMS
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I'm trying to use transactions with the DefaultMessageContainerListener. I want to also reuse the same session for sending a message to another destination while processing the input message. Unfortunately, the session is not part of the spring transactional resource if caching is set to SESSION or CONSUMER.

      Line 883 (http://springframework.cvs.sourceforge.net/springframework/spring/src/org/springframework/jms/listener/DefaultMessageListenerContainer.java?revision=1.35&view=markup#l_883) shows that createSession(getSharedConnection()) is called to create the session for this consumer instead of ConnectionFactoryUtils.doGetTransactionalSession() as done in AbstractPollingMessageListenerContainer.

      This prevents the same session to be reused for sending JMS messages.

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              gnodet Guillaume Nodet
              Last updater:
              Spring Issuemaster
            • Votes:
              15 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 12 weeks, 3 days ago