This question is more general than specifically about JBoss TM, but I thought the
developers of JBoss TM might have an idea about it. It is about whether propagating the
transaction context between different threads in asynchronous invocations is possible or
not. It is hard to find specific information about this topic, some technologies say
specifically that they don't implement it but they never say why.
To give some context i'm studying the integration of QoS (Quality of Service) into a
component-model based framework.
The components expose used and provided services, produced and consumed events, and used
and provided parameters. They live inside a light container (the component manager) that
manages their lifecycle and plugs the QoS into service/event/parameter invocations by
AOP.
The QoS include transactional behaviour and asynchronicity (we already have implemented
Asynchronous Method Invocation and Asynchronous Method Dispatch), so i have to see if they
are "orthogonal" or if they restrict each other, both in current technologies
and in what is theoretically possible (and if impossible why).
My question is: is there a fundamental, intrinsic incompatibility between asynchronicity
and the propagation of the transaction context?
Even in the (relatively recent) EJB 3.1 spec, it is mentioned that for the new
@Asynchronous methods, the transaction context will not be propagated from the caller to
the callee (but they don't say why).
But is it really an absolute impossibility?
After all during a remote transactional invocation, the transaction context is propagated
to a different thread (from the client thread to the server thread) by rmi , so the
transaction context doesn't have to be strictly thread-local.
Of course the service that is invoked asynchronously would/might return before committing,
but that is not always unacceptable (like caches replicate their changes asynchronously
after a service call), and it wouldn't prevent it from sharing the same transaction
context.
So if there is an impossibility it doesn't come from sharing the transactional context
between threads but from asynchronicity. What do you think?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255078#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...