db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core QueryReferenceBroker.java
Date Mon, 05 Jan 2004 01:10:09 GMT
olegnitz    2004/01/04 17:10:09

  Modified:    src/java/org/apache/ojb/broker/core
                        QueryReferenceBroker.java
  Log:
  Fixed bug: materialization listeners for proxy prefetching were not removed
  during transaction commit (thanks to Andy Malakov for finding it)
  
  Revision  Changes    Path
  1.7       +17 -15    db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
  
  Index: QueryReferenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- QueryReferenceBroker.java	30 Dec 2003 21:09:19 -0000	1.6
  +++ QueryReferenceBroker.java	5 Jan 2004 01:10:09 -0000	1.7
  @@ -171,9 +171,8 @@
                               && (cld.getProxyPrefetchingLimit() > 0)
                               && addRetrievalTask(candidate, this))
                       {
  -                        handler.addListener(
  -                                new PBMaterializationListener(m_retrievalTasks, this,
  -                                cld.getProxyPrefetchingLimit()));
  +                        new PBMaterializationListener(handler, m_retrievalTasks,
  +                                this, cld.getProxyPrefetchingLimit());
                       }
                   }
               }
  @@ -312,7 +311,7 @@
                       continue;
                   }
   
  -                prefetcher = RelationshipPrefetcherFactory.createRelationshipPrefetcher(pb,
ord);    
  +                prefetcher = RelationshipPrefetcherFactory.createRelationshipPrefetcher(pb,
ord);
                   prefetcher.prefetchRelationship(owners);
                   it.remove();
               }
  @@ -372,8 +371,8 @@
                       if ((handler != null)
                               && addRetrievalTask(obj, rds))
                       {
  -                        handler.addListener(
  -                                new PBMaterializationListener(m_retrievalTasks, rds, rds.getProxyPrefetchingLimit()));
  +                        new PBMaterializationListener(handler, m_retrievalTasks,
  +                                rds, rds.getProxyPrefetchingLimit());
                       }
                   }
               }
  @@ -546,9 +545,8 @@
                   {
                       if (addRetrievalTask(obj, cds))
                       {
  -                        ((CollectionProxy) value).addListener(
  -                                new PBCollectionProxyListener(m_retrievalTasks, cds,
  -                                cds.getProxyPrefetchingLimit()));
  +                        new PBCollectionProxyListener((CollectionProxy) value,
  +                                m_retrievalTasks, cds, cds.getProxyPrefetchingLimit());
                       }
                   }
               }
  @@ -728,9 +726,10 @@
       {
           private IndirectionHandler _listenedHandler;
   
  -        PBMaterializationListener(HashMap retrievalTasks, Object key, int limit)
  +        PBMaterializationListener(IndirectionHandler listenedHandler,
  +                HashMap retrievalTasks, Object key, int limit)
           {
  -            super(retrievalTasks, key, limit);
  +            super(listenedHandler, retrievalTasks, key, limit);
           }
   
           protected void addThisListenerTo(Object listenedObject)
  @@ -783,7 +782,8 @@
           private int _limit;
           protected Object _key;
   
  -        PBPrefetchingListener(HashMap retrievalTasks, Object key, int limit)
  +        PBPrefetchingListener(Object listenedObject, HashMap retrievalTasks,
  +                Object key, int limit)
           {
               _retrievalTasks = retrievalTasks;
               _key = key;
  @@ -792,6 +792,7 @@
               {
                   prefetchingListeners = new ArrayList();
               }
  +            addThisListenerTo(listenedObject);
               prefetchingListeners.add(this);
           }
   
  @@ -859,9 +860,10 @@
       {
           CollectionProxy _listenedCollection;
   
  -        PBCollectionProxyListener(HashMap retrievalTasks, CollectionDescriptor key, int
limit)
  +        PBCollectionProxyListener(CollectionProxy listenedCollection,
  +                HashMap retrievalTasks, CollectionDescriptor key, int limit)
           {
  -            super(retrievalTasks, key, limit);
  +            super(listenedCollection, retrievalTasks, key, limit);
           }
   
           protected void addThisListenerTo(Object listenedObject)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message