How can I get the instance of the transaction from a CMT EJB method?
Something like in BMT: context.getUserTransaction().
I know I can't change the properties of a CMT transaction, but I would like to display those properties.
For instance I would like to see the ID of the transaction in order to compare to the IDs shown in the log file.
You can inject an EjbContext into your session or messagedrivenbean.
From this context you can call ejbContext.getUserTransaction()
Note from the Javadocs that you are only allowed to use this
if your enterprise bean is using bean managed transactions.
You can also lookup an instance of UserTransaction, for example,