User: simone  
  Date: 01/01/10 12:48:25

  Modified:    src/main/org/jboss/ejb/plugins BMPPersistenceManager.java
  Log:
  Fixed a bug in findByPrimaryKey.
  Patch submitted by Andrius Juozapaitis ([EMAIL PROTECTED]).
  
  Revision  Changes    Path
  1.21      +7 -2      jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java
  
  Index: BMPPersistenceManager.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- BMPPersistenceManager.java        2000/12/27 18:33:42     1.20
  +++ BMPPersistenceManager.java        2001/01/10 20:48:24     1.21
  @@ -36,7 +36,7 @@
   *   @see <related>
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  -*   @version $Revision: 1.20 $
  +*   @version $Revision: 1.21 $
   */
   public class BMPPersistenceManager
   implements EntityPersistenceManager
  @@ -434,7 +434,12 @@
         // If so we check if the entity is in cache first
         if (finderMethod.getName().equals("findByPrimaryKey"))
         {
  -         if (con.getInstanceCache().isActive(args[0]))
  +         Object key = ctx.getCacheKey();
  +         if (key == null)
  +         {
  +            key = ((EntityCache)con.getInstanceCache()).createCacheKey(args[0]);
  +         }
  +         if (con.getInstanceCache().isActive(key))
               return args[0]; // Object is active -> it exists -> no need to call 
finder
         }
   
  
  
  

Reply via email to