Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why JMS Session Object is not thread safe?

Tags:

java

jms

jms2

Why are JMS specs designed in the way so that Session Object cannot be used by concurrent threads when Connection object from which Sessions are created are thread safe(Shared by thread)?

like image 428
Aniket Thakur Avatar asked Dec 13 '13 06:12

Aniket Thakur


1 Answers

JMS Session object is typically used for Transactions. And we all know transactions are thread specific and can't span across threads. Hence a transacted JMS session can't be used across threads. I believe for this reason JMS specification says session is not thread safe.

like image 148
Shashi Avatar answered Sep 20 '22 21:09

Shashi