For those interested, turns out, there is a very easy JBossTM API that I can
use in my interceptor code to do what I want... this static method:
com.arjuna.ats.arjuna.coordinator.BasicAction.Current.setCheckedAction()
Mark Little already gave me the answer in that other thread, I just didn't
un
Ah...good suggestion. I just tried that (looked up the java:/TransactionManager
from JNDI and executed the getTransaction() method from the object that lookup
returned.
And, it turns out, it looks like I don't even have to do that much. I found
that rather than going through JNDI, I can simply
If you get the TransactionManager from JNDI, then get the Thread's current Tx
from there, that's not sufficient for you? It's some wrapper object and you
need an underlying impl (much like EntityManager.getDelegate() provides)?
S,
ALR
View the original post :
http://www.jboss.com/index.html?m
OK, I'll ask this in a different way...
If I write my own EJB3 interceptor (using @AroundInvoke and defined with
), how can I get the transaction that is associated with
the active thread that is executing the request?
If I can get the transaction that the EJB3 invocation is running in , I thin
I'm thinking I might be able to inject an interceptor in my EJB3 interceptor
chain - write my own annotation like @InterruptOnTimeout - and when the method
is called, the interceptor looks for the existance of this annotation on the
method and if it finds it, it grabs the transaction and adds my
BTW: the reason why I want to customize this behavior is described here:
http://management-platform.blogspot.com/2008/11/transaction-timeouts-and-ejb3jpa.html
In short, I don't want my SLSB method to continue when the transaction timeout
expires - I want the thread running that method to be inte