After going through this posts, we have implemented the passing of context ( in 
our case an id ) during a transaction using the interceptors at ejb proxy and 
container level as suggested by Scott.

As such the Invocation object, which has holds the payload to be used during 
the chain of invocation, didn't retain our value set during the whole 
transaction, so we had to use ThreadLocal objects, to propogate the id.

Moreover couldnt find a better way of injecting the "id", than tampering with 
the Principal object. ( The "id" injected as the name of the caller principal 
is used by the entities to query an in memory datastructure to get the current 
transaction context).

The above implementation works, need to do so rigorous testing, but it works.


Is it safe to use ThreadLocal objects in Interceptors? 
Is there a better way to inject an "id", rather than tampering Principal?

Please suggest.

Thanks
Vikram.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3882695#3882695

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3882695


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to