arminw 2005/07/24 16:29:14
Modified: src/java/org/apache/ojb/broker/cache Tag: OJB_1_0_RELEASE
MaterializationCache.java ObjectCacheInternal.java
Log:
try to fix problem with multiple cached objects overwriting previous cached
objects when materialisation cache is enabled
Revision Changes Path
No revision
No revision
1.1.2.5 +9 -3
db-ojb/src/java/org/apache/ojb/broker/cache/Attic/MaterializationCache.java
Index: MaterializationCache.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/Attic/MaterializationCache.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- MaterializationCache.java 7 Jul 2005 17:03:03 -0000 1.1.2.4
+++ MaterializationCache.java 24 Jul 2005 23:29:14 -0000 1.1.2.5
@@ -202,8 +202,14 @@
{
entry = (Map.Entry) it.next();
oe = (ObjectEntry) entry.getValue();
- if(log.isDebugEnabled()) log.debug("Push to cache: " +
entry.getKey());
- cacheDistributor.doInternalCache((Identity) entry.getKey(),
oe.obj, oe.type);
+ /*
+ never push temporary object to a higher level cache
+ */
+ if(oe.type != TYPE_TEMP)
+ {
+ if(log.isDebugEnabled()) log.debug("Push to cache: " +
entry.getKey());
+ cacheDistributor.doInternalCache((Identity) entry.getKey(),
oe.obj, oe.type);
+ }
}
}
1.1.2.3 +7 -1
db-ojb/src/java/org/apache/ojb/broker/cache/Attic/ObjectCacheInternal.java
Index: ObjectCacheInternal.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/Attic/ObjectCacheInternal.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ObjectCacheInternal.java 7 Feb 2005 20:42:42 -0000 1.1.2.2
+++ ObjectCacheInternal.java 24 Jul 2005 23:29:14 -0000 1.1.2.3
@@ -41,6 +41,12 @@
* Object caching type was unkown.
*/
public static final int TYPE_UNKNOWN = 0;
+ /**
+ * Object caching type used for temporary storage of objects,
+ * these objects will never be pushed to a higher level cache.
+ */
+ public static final int TYPE_TEMP = -1;
+
/**
* For internal use.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]