Description
Joel Caplin opened SPR-5031 and commented
The JMS spec states that: "Closing a transacted session must roll back the transaction in progress": http://java.sun.com/javaee/5/docs/api/javax/jms/Session.html#close().
The CachingConnectionFactory does not appear to adhere to this rule. When a locally-transaction Session object is created using the cached Connection, calls to close() do not result in rollback() being called. Test case attached.
At runtime this can cause unexpected behavior. For example: I use a cached session and close it out, expecting an implicit rollback; a few seconds later, unbeknowst to me, I'm using the same cached session again, except I commit this time. The first implied rollback never happens so everything that took part in the first 'session' is actually commited.
Affects: 2.5.5
Attachments:
- CachingConnectionFactoryTest.java (2.21 kB)
- CachingConnectionFactoryTests.java (4.69 kB)
Issue Links:
- CachingConnectionFactory should catch exceptions on logical close [SPR-12148] #16762 CachingConnectionFactory should catch exceptions on logical close