In case we want a JMS session to participate in transaction, we create a JMS session with session parameter to true.
But, where does I mentioned JMS that it the session being participated in transaction is local transaction or global transaction?
In other words, do I have control to make JMS participate in local or global transaction or it is Application Container who will decide?
It depends on the connection factory you use.
The specification for JMS specifies two different types of connection factories with each type containing three interfaces.
for the XA connection factories and
for the non-XA connection factories. If you use XA** , then your JMS session will participate in a global transaction. Of course, this part is abstracted away from your code since one typically configures the connection factories via the provider-specific interfaces and then looks them up through JNDI.
Here is a link that talks about global transactions for JMS in WebLogic.