JBoss 2.1

After deleting (remove()) an entity, if I try to create a new entity with
the same primary key as the previously deleted one, I get the following
exception

 java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID =
com.mentumgroup.janet.lisa.cre
  at
org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.jav
a:207)
  at
org.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPersistenceManag
er.java:165)
  at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441)
  at java.lang.reflect.Method.invoke(Native Method)
  at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.java:639)
  at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hronizationInterceptor.j
  at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erceptor.java:87)
  at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
  at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:264)
  at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
  at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
a:119)
  at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
  at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316)
  at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai
nerInvoker.java:421)
  ...

HOWEVER, if I wait a few minutes before re-using the primary key, all works
as expected.  It would appear from the above stack trace that although the
entity has been correctly deleted (the database delete worked) that the
entity stays in the cache for some period after.

Any ideas why?

Thanks in advance

David

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to