User: danch   
  Date: 01/06/15 16:59:07

  Modified:    src/main/org/jboss/ejb/plugins CMPPersistenceManager.java
  Log:
  Clean up of stuff left over in CMPPersistenceManager from 1st round finder 
optimization: my test (1000 entities) now completes in about 8.7 seconds - cached was 
6.4 seconds
  
  Revision  Changes    Path
  1.21      +7 -31     jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java
  
  Index: CMPPersistenceManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- CMPPersistenceManager.java        2001/06/04 20:46:42     1.20
  +++ CMPPersistenceManager.java        2001/06/15 23:59:07     1.21
  @@ -46,7 +46,8 @@
   *
   *   @see <related>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -*   @version $Revision: 1.20 $
  +*   @author <a href="mailto:[EMAIL PROTECTED]";>danch (Dan Christopherson</a>
  +*   @version $Revision: 1.21 $
   */
   public class CMPPersistenceManager
   implements EntityPersistenceManager {
  @@ -299,44 +300,19 @@
          return ((EntityCache) con.getInstanceCache()).createCacheKey(id);
       }
   
  +    /** find multiple entities */
       public Collection findEntities(Method finderMethod, Object[] args, 
EntityEnterpriseContext ctx)
           throws Exception 
       {
          // The store will find the id and return a collection of PrimaryKeys
          FinderResults ids = store.findEntities(finderMethod, args, ctx);
  -
  -       AbstractInstanceCache cache = (AbstractInstanceCache)con.getInstanceCache();
  -       Map contextMap = new HashMap();
  -       ArrayList keyList = new ArrayList();
  -       Iterator idEnum = ids.iterator();
  -       while(idEnum.hasNext()) {
  -          Object key = idEnum.next();
  -          Object cacheKey = ((EntityCache)cache).createCacheKey(key);
  -          keyList.add(cacheKey);
  -                   
  -          Sync mutex = (Sync)cache.getLock(cacheKey);
  -          try
  -          {
  -             mutex.acquire();
  -
  -             // Get context
  -             ctx = (EntityEnterpriseContext)cache.get(cacheKey);
  -             // if ctx has a transaction, we skip it - either it's our Tx
  -             //    or we plain don't want to block here.
  -             if (ctx.getTransaction() == null) {
  -                contextMap.put(key, ctx);
  -             } 
  -          } catch (InterruptedException ignored) {
  -          } finally {
  -             mutex.release();
  -          }
  -       }
  -       
  -       ids.setEntityMap(contextMap);
          
          store.loadEntities(ids);
   
  -       return keyList;
  +       // Note: for now we just return the keys - RabbitHole should return the
  +       //   finderResults so that the invoker layer can extend this back 
  +       //   giving the client an OO 'cursor'
  +       return ids.getAllKeys();
       }
   
       /*
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to