dain 2005/02/16 01:12:38 Modified: modules/core/src/java/org/openejb/entity/cmp CMPEntityInterceptorBuilder.java Log:
Added reentrancy detection, and throw exception when reentering a non-reentrant entity Revision Changes Path 1.3 +13 -4 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CMPEntityInterceptorBuilder.java 12 Feb 2005 18:44:00 -0000 1.2 +++ CMPEntityInterceptorBuilder.java 16 Feb 2005 06:12:38 -0000 1.3 @@ -70,7 +70,8 @@ */ public class CMPEntityInterceptorBuilder extends AbstractInterceptorBuilder { private CacheFlushStrategyFactory strategyFactory; - + private boolean reentrant; + public CacheFlushStrategyFactory getCacheFlushStrategyFactory() { return strategyFactory; } @@ -78,7 +79,15 @@ public void setCacheFlushStrategyFactory(CacheFlushStrategyFactory strategyFactory) { this.strategyFactory = strategyFactory; } - + + public boolean isReentrant() { + return reentrant; + } + + public void setReentrant(boolean reentrant) { + this.reentrant = reentrant; + } + public TwoChains buildInterceptorChains() { if (transactionContextManager == null) { throw new IllegalStateException("Transaction context manager must be set before building the interceptor chain"); @@ -113,7 +122,7 @@ if (trackedConnectionAssociator != null) { firstInterceptor = new ConnectionTrackingInterceptor(firstInterceptor, trackedConnectionAssociator); } - firstInterceptor = new EntityInstanceInterceptor(firstInterceptor, containerId, instancePool); + firstInterceptor = new EntityInstanceInterceptor(firstInterceptor, containerId, instancePool, reentrant); firstInterceptor = new InTxCacheInterceptor(firstInterceptor, strategyFactory); firstInterceptor = new TransactionContextInterceptor(firstInterceptor, transactionContextManager, transactionPolicyManager); firstInterceptor = new SystemExceptionInterceptor(firstInterceptor, ejbName);