User: simone  
  Date: 01/01/11 16:05:54

  Modified:    src/main/org/jboss/ejb/plugins
                        EntityInstanceInterceptor.java
  Log:
  Fixed a bug when removing a bean with a transaction associated to the remove() 
method.
  
  Revision  Changes    Path
  1.28      +11 -1     
jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java
  
  Index: EntityInstanceInterceptor.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- EntityInstanceInterceptor.java    2001/01/04 09:16:16     1.27
  +++ EntityInstanceInterceptor.java    2001/01/12 00:05:53     1.28
  @@ -45,7 +45,7 @@
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
  -*   @version $Revision: 1.27 $
  +*   @version $Revision: 1.28 $
   */
   public class EntityInstanceInterceptor
   extends AbstractInterceptor
  @@ -237,6 +237,16 @@
   
                                                        // It has been removed -> send 
to the pool
                                                        
container.getInstancePool().free(ctx);
  +                                             }
  +                                             else 
  +                                             {
  +                                                     // We want to remove the bean, 
but it has a Tx associated with 
  +                                                     // the remove() method. We 
remove it from the cache, to avoid
  +                                                     // that a successive insertion 
with same pk will break the
  +                                                     // cache. Anyway we don't free 
the context, since the tx must
  +                                                     // finish. The 
EnterpriseContext instance will be GC and not
  +                                                     // recycled.
  +                                                     cache.remove(key);
                                                }
                                        }
                                        else
  
  
  

Reply via email to