db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core PersistenceBrokerImpl.java
Date Fri, 01 Oct 2004 11:02:09 GMT
arminw      2004/10/01 04:02:09

  Modified:    src/java/org/apache/ojb/broker/accesslayer Tag:
                        OJB_1_0_RELEASE RsIterator.java
               src/java/org/apache/ojb/broker/cache Tag: OJB_1_0_RELEASE
                        InternalCache.java
               src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        PersistenceBrokerImpl.java
  Log:
  Update fix for materialization problem under heavy load
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.63.2.4  +21 -27    db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
  
  Index: RsIterator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java,v
  retrieving revision 1.63.2.3
  retrieving revision 1.63.2.4
  diff -u -r1.63.2.3 -r1.63.2.4
  --- RsIterator.java	30 Sep 2004 14:02:03 -0000	1.63.2.3
  +++ RsIterator.java	1 Oct 2004 11:02:08 -0000	1.63.2.4
  @@ -452,32 +452,26 @@
                       synchronized (result)
                       {
                           getCache().enableMaterializationCache();
  -                        try
  -                        {
  -                            getCache().cache(oid, result);
  -                            /*
  -                             * arminw: move LoadedObjectsRegistry to odmg-layer
  -                             */
  -                            // LoadedObjectsRegistry.register(result);
  -                            /**
  -                             * MBAIRD if you have multiple classes mapped to a
  -                             * table, and you query on the base class you could get
  -                             * back NON base class objects, so we shouldn't pass
  -                             * m_cld, but rather the class descriptor for the
  -                             * actual class.
  -                             */
  -                            // fill reference and collection attributes
  -                            ClassDescriptor cld = getBroker().getClassDescriptor(result.getClass());
  -                            // don't force loading of reference
  -                            final boolean unforced = false;
  -                            // Maps ReferenceDescriptors to HashSets of owners
  -                            getBroker().getReferenceBroker().retrieveReferences(result,
cld, unforced);
  -                            getBroker().getReferenceBroker().retrieveCollections(result,
cld, unforced);
  -                        }
  -                        finally
  -                        {
  -                            getCache().disableMaterializationCache();
  -                        }
  +                        getCache().cache(oid, result);
  +                        /*
  +                         * arminw: move LoadedObjectsRegistry to odmg-layer
  +                         */
  +                        // LoadedObjectsRegistry.register(result);
  +                        /**
  +                         * MBAIRD if you have multiple classes mapped to a
  +                         * table, and you query on the base class you could get
  +                         * back NON base class objects, so we shouldn't pass
  +                         * m_cld, but rather the class descriptor for the
  +                         * actual class.
  +                         */
  +                        // fill reference and collection attributes
  +                        ClassDescriptor cld = getBroker().getClassDescriptor(result.getClass());
  +                        // don't force loading of reference
  +                        final boolean unforced = false;
  +                        // Maps ReferenceDescriptors to HashSets of owners
  +                        getBroker().getReferenceBroker().retrieveReferences(result, cld,
unforced);
  +                        getBroker().getReferenceBroker().retrieveCollections(result, cld,
unforced);
  +                        getCache().disableMaterializationCache();
                       }
                   }
               }
  
  
  
  No                   revision
  No                   revision
  1.5.2.2   +3 -4      db-ojb/src/java/org/apache/ojb/broker/cache/Attic/InternalCache.java
  
  Index: InternalCache.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/Attic/InternalCache.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- InternalCache.java	30 Sep 2004 14:02:03 -0000	1.5.2.1
  +++ InternalCache.java	1 Oct 2004 11:02:08 -0000	1.5.2.2
  @@ -123,8 +123,7 @@
       {
           if(localCache.size() > 0)
           {
  -            log.warn("Found " + localCache.size() + " abandoned objects in local cache,
check code to force" +
  -                    " push to real ObjectCache");
  +            log.info("Found " + localCache.size() + " abandoned objects in local cache");
           }
           localCache.clear();
           invokeCounter = 0;
  @@ -133,7 +132,7 @@
   
       public void clear()
       {
  -        localCache.clear();
  +        localClear();
           realCache.clear();
       }
   }
  
  
  
  No                   revision
  No                   revision
  1.83.2.5  +3 -10     db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java,v
  retrieving revision 1.83.2.4
  retrieving revision 1.83.2.5
  diff -u -r1.83.2.4 -r1.83.2.5
  --- PersistenceBrokerImpl.java	30 Sep 2004 14:02:03 -0000	1.83.2.4
  +++ PersistenceBrokerImpl.java	1 Oct 2004 11:02:08 -0000	1.83.2.5
  @@ -1351,15 +1351,8 @@
       public Object getObjectByIdentity(Identity id) throws PersistenceBrokerException
       {
           objectCache.enableMaterializationCache();
  -        Object result;
  -        try
  -        {
  -            result = doGetObjectByIdentity(id);
  -        }
  -        finally
  -        {
  -            objectCache.disableMaterializationCache();
  -        }
  +        Object result = doGetObjectByIdentity(id);
  +        objectCache.disableMaterializationCache();
           return result;
       }
   
  
  
  

---------------------------------------------------------------------
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