1 Reply Latest reply on Jun 23, 2005 8:51 AM by ebrain13

    Propogation of an identifier during a transaction using inte

    ebrain13 Newbie

      Hello,

      We have a requirement of propogating an identifier ( on the similar lines of Principal propogation in JAAS) during a transaction.

      I had a look at the interceptor framework and some postings in this forum and finally came to conclusion that adding the interceptors at following levels in jboss configuration the above problem can be resolved.

      invoker proxy --> container

      BUT, I found that we cannot propogate a value stored in Invocation object to the last call at entity level as the BaseLocalProxyInterceptor creates a new Invocation object. ( we have a session facade pattern, were by a session bean interacts with local enterprise entity beans ).

      Also, found that using ThreadLocal objects the same can be achieved, created a sample test and was able to propogate the id from SessionInterceptor to EntityInstanceInterceptor.

      Couldnt find a better way of injecting the "id" into the entity, than tampering with the Principal object set in the entity context.

      So my questions are :

      1) Is it safe to use ThreadLocal objects in Interceptors? ( I have seen use of ThreadLocals in classes like "Container" etc )

      2) Is there a better way to inject such objects into local enterprise entity beans.

      Plesae advise.

      Thanks,
      Vikram