arminw      2005/07/24 17:05:35

  Modified:    src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        PersistenceBrokerImpl.java
  Log:
  use TYPE_TEMP for temporary cached objects in the materialization cache
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.83.2.26 +10 -15    
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.25
  retrieving revision 1.83.2.26
  diff -u -r1.83.2.25 -r1.83.2.26
  --- PersistenceBrokerImpl.java        7 Jul 2005 17:16:21 -0000       
1.83.2.25
  +++ PersistenceBrokerImpl.java        25 Jul 2005 00:05:34 -0000      
1.83.2.26
  @@ -966,12 +966,6 @@
               }
               else store(ref);
           }
  -        else
  -        {
  -            if(logger.isEnabledFor(Logger.INFO))
  -                logger.info("Cascade store for this reference-descriptor ("
  -                        + rds.getAttributeName() +") was set to false.");
  -        }
           link(obj, cld, rds, ref, insert);
       }
   
  @@ -1315,19 +1309,20 @@
           getInternalCache().enableMaterializationCache();
           // to avoid problems with circular references, locally cache the 
current object instance
           Identity oid = serviceIdentity().buildIdentity(pInstance);
  -        boolean needLocalRemove = false;
  +//        boolean needLocalRemove = false;
           if(getInternalCache().doLocalLookup(oid) == null)
           {
  -            getInternalCache().doInternalCache(oid, pInstance, 
MaterializationCache.TYPE_UNKNOWN);
  -            needLocalRemove = true;
  +            getInternalCache().doInternalCache(oid, pInstance, 
MaterializationCache.TYPE_TEMP);
  +//            needLocalRemove = true;
           }
           try
           {
               referencesBroker.retrieveReferences(pInstance, cld, true);
               referencesBroker.retrieveCollections(pInstance, cld, true);
  -            // do locally remove the object to avoid problems with object 
state detection (insert/update),
  -            // because objects found in the cache detected as 'old' means 
'update'
  -            if(needLocalRemove) getInternalCache().doLocalRemove(oid);
  +// arminw: should no longer needed since we use TYPE_TEMP for this kind of 
objects
  +//            // do locally remove the object to avoid problems with object 
state detection (insert/update),
  +//            // because objects found in the cache detected as 'old' means 
'update'
  +//            if(needLocalRemove) getInternalCache().doLocalRemove(oid);
               getInternalCache().disableMaterializationCache();
           }
           catch(RuntimeException e)
  @@ -1358,7 +1353,7 @@
           boolean needLocalRemove = false;
           if(getInternalCache().doLocalLookup(oid) == null)
           {
  -            getInternalCache().doInternalCache(oid, pInstance, 
MaterializationCache.TYPE_UNKNOWN);
  +            getInternalCache().doInternalCache(oid, pInstance, 
MaterializationCache.TYPE_TEMP);
               needLocalRemove = true;
           }
           try
  @@ -1422,7 +1417,7 @@
               getInternalCache().enableMaterializationCache();
               if(tmp == null)
               {
  -                getInternalCache().doInternalCache(oid, obj, 
MaterializationCache.TYPE_UNKNOWN);
  +                getInternalCache().doInternalCache(oid, obj, 
MaterializationCache.TYPE_TEMP);
               }
               if(logger.isDebugEnabled()) logger.debug("Refresh relationships 
for " + oid);
               iter = cld.getCollectionDescriptors().iterator();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to