0 Replies Latest reply on Jan 20, 2004 5:20 PM by Mohan Kishore

    Error using compound-keys with back-end deletes

    Mohan Kishore Newbie

       

      "mohankishore" wrote:
      Am using JBoss3.0.0. And we need to use back-end deletes to support bulk deletes using custom business logic. Hence, we have the commit option set to 'B'. Having some problems in a table with compound key.

      It throws an error if we try to insert too soon after we delete a bean with the same key. If we wait for a while, it seems to work fine.

      Am appending a stack-trace. Note that have added a findByPrimaryKey call to debug the problem. The findByPrimaryKey does not find the deleted bean, but it seems that the cache somehow maintains a reference to an active bean... Shouldn't commit option 'B' take care of this? Have tried setting the <overager-period> and <max-bean-age> to very small values - which seems to help, but isnt an acceptable solution...

      STACK TRACE FOLLOWS:

      14:52:37,546 INFO [STDOUT] deleteProductScopeCustomAttributes: 2401, 1200, [1]
      14:52:45,687 INFO [STDOUT] updateProductScopeCustomAttributes: 2401, [CustomAttributeData[null, null, null, null, null, T, asas, null]], 1200, 0, 0, 0
      14:52:45,718 INFO [STDOUT] Looking up the existing bean: ProductScopeAttributePK[2401, 1]
      14:52:45,718 INFO [STDOUT] Error looking up the existing bean: No such entity!
      14:52:45,734 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
      java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID = ProductScopeAttributePK[2401, 1]
      at org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:221)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:147)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:227)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy255.create(Unknown Source)
      at com.betasphere.core.components.customAttributeManager.CustomAttributeManagerSLBean.updateProductScopeCustomAttributes(CustomAttributeManagerSLBean.java:461)