User: fleury  
  Date: 00/10/14 00:21:57

  Modified:    src/main/org/jboss/ejb/plugins
                        EntitySynchronizationInterceptor.java
  Log:
  the rickard fix, now an independent thread can commit a transaction and the right CL 
will be associated with it.
  
  Note that both before and after completion calls are changed so that it works on 
commit/rollback and timeouts (timeouts only call afterCompletion)
  
  Revision  Changes    Path
  1.22      +10 -1     
jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
  
  Index: EntitySynchronizationInterceptor.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- EntitySynchronizationInterceptor.java     2000/10/09 20:14:27     1.21
  +++ EntitySynchronizationInterceptor.java     2000/10/14 07:21:57     1.22
  @@ -48,7 +48,7 @@
   *   @see <related>
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  -*   @version $Revision: 1.21 $
  +*   @version $Revision: 1.22 $
   */
   public class EntitySynchronizationInterceptor
   extends AbstractInterceptor
  @@ -337,6 +337,10 @@
                {
                        // DEBUG Logger.debug("beforeCompletion called for ctx 
"+ctx.hashCode());
                        
  +                     // This is an independent point of entry. We need to make sure 
the 
  +                     // thread is associated with the right context class loader
  +                     
Thread.currentThread().setContextClassLoader(container.getClassLoader());
  +                     
                        if (ctx.getId() != null) {
                                try {
                                        try {
  @@ -388,6 +392,11 @@
                
                public void afterCompletion(int status)
                {
  +                     
  +                     // This is an independent point of entry. We need to make sure 
the 
  +                     // thread is associated with the right context class loader
  +                     
Thread.currentThread().setContextClassLoader(container.getClassLoader());
  +                     
                        if (ctx.getId() != null) {
                                
                                //DEBUG Logger.debug("afterCompletion called for ctx 
"+ctx.hashCode());
  
  
  

Reply via email to