Description
Creating a CMP bean removing it and recreating a bean with the same identity in a single transaction causes tranql to throw a org.tranql.cache.DuplicateIdentityException. This should not throw an exception in this case because the previously existing bean has already been removed.
Further, if the code happens throws this exception for a valid reason, it should not be propagated back to the client as a system exception; instead the client should get javax.ejb.DuplicateKeyException..
java.rmi.RemoteException: org.tranql.cache.AlreadyAssociatedException; nested exception is:
org.tranql.cache.DuplicateIdentityException: org.tranql.cache.AlreadyAssociatedException
at org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.java:132)
at org.openejb.proxy.EntityEJBHome$$EnhancerByCGLIB$$21abc7d9.create(<generated>)
<snip/>
Caused by: org.tranql.cache.DuplicateIdentityException: org.tranql.cache.AlreadyAssociatedException
at org.tranql.cache.CacheTable.addRow(CacheTable.java:90)
at org.openejb.entity.cmp.CMPCreateMethod.execute(CMPCreateMethod.java:187)
at org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java:72)
at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(ComponentContextInterceptor.java:56)
at org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInterceptor.java:81)
at org.openejb.entity.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:125)
at org.openejb.entity.cmp.InTxCacheInterceptor.invoke(InTxCacheInterceptor.java:82)
at org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:123)
at org.openejb.transaction.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:80)
at org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor.java:82)
at org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:221)
at org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.java:123)
... 31 more
Caused by: org.tranql.cache.AlreadyAssociatedException
at org.tranql.cache.InTxCache.associate(InTxCache.java:43)
at org.tranql.cache.CacheTable.addRow(CacheTable.java:88)
... 42 more