gdamour 2005/10/08 00:45:58
Modified: modules/core/src/java/org/openejb/entity/cmp
CMPEJBContainer.java
CMPEntityInterceptorBuilder.java
InTxCacheInterceptor.java
Log:
GERONIMO-188 Entity instance caching
o The same FrontEndCacheDelegate needs to be shared across the CMP containers.
o Add the repeatable-read isolation level.
o findByPrimaryKey also queries the cache prior to hit the database.
o Remove two redundant cache queries when retrieving CMP and CMR fields.
Revision Changes Path
1.2 +5 -5
openejb/modules/core/src/java/org/openejb/entity/cmp/CMPEJBContainer.java
Index: CMPEJBContainer.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/CMPEJBContainer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CMPEJBContainer.java 1 Oct 2005 08:44:09 -0000 1.1
+++ CMPEJBContainer.java 8 Oct 2005 04:45:58 -0000 1.2
@@ -107,19 +107,19 @@
Cache cache = factory.factory();
FrontEndCache frontEndCache = new FrontEndToCacheAdaptor(tm, cache);
- delegate.setFrontEndCache(frontEndCache);
+ delegate.addFrontEndCache(getEjbName(), frontEndCache);
}
public void doStop() throws Exception {
super.doStop();
- delegate.setFrontEndCache(null);
+ delegate.removeFrontEndCache(getEjbName());
}
public void doFail() {
super.doFail();
- delegate.setFrontEndCache(null);
+ delegate.removeFrontEndCache(getEjbName());
}
public static final GBeanInfo GBEAN_INFO;
1.6 +1 -2
openejb/modules/core/src/java/org/openejb/entity/cmp/CMPEntityInterceptorBuilder.java
Index: CMPEntityInterceptorBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/CMPEntityInterceptorBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CMPEntityInterceptorBuilder.java 1 Oct 2005 08:44:09 -0000 1.5
+++ CMPEntityInterceptorBuilder.java 8 Oct 2005 04:45:58 -0000 1.6
@@ -62,7 +62,6 @@
import org.openejb.security.PolicyContextHandlerEJBInterceptor;
import org.openejb.transaction.TransactionContextInterceptor;
import org.tranql.cache.CacheFlushStrategyFactory;
-import org.tranql.cache.cache.Cache;
import org.tranql.cache.cache.FrontEndCache;
/**
1.4 +6 -8
openejb/modules/core/src/java/org/openejb/entity/cmp/InTxCacheInterceptor.java
Index: InTxCacheInterceptor.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/InTxCacheInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InTxCacheInterceptor.java 1 Oct 2005 08:44:09 -0000 1.3
+++ InTxCacheInterceptor.java 8 Oct 2005 04:45:58 -0000 1.4
@@ -86,16 +86,14 @@
strategy = new InTxCacheTracker(cache, strategy);
transactionContext.setInTxCache(new GeronimoInTxCache(strategy));
}
-
+
return next.invoke(invocation);
}
- public static class GeronimoInTxCache extends InTxCache implements
Flushable {
-
- public GeronimoInTxCache(CacheFlushStrategy flushStrategy) {
- super(flushStrategy);
- }
-
+ private static class GeronimoInTxCache extends InTxCache implements
Flushable {
+ public GeronimoInTxCache(CacheFlushStrategy strategy) {
+ super(strategy);
+ }
}
}