10 Replies Latest reply on May 2, 2002 4:50 AM by Chris Harris

    Problems with the jboss container cache

    Daniel Albrecht Newbie

      In the session bean I delete some data records into a database table over the find by primary key method. Thereafter I will create new data record with the same primary key fields like before. The jboss throw a exception like follow :

      [ERROR,ProductAttrDefault] TRANSACTION ROLLBACK EXCEPTION:
      javax.transaction.TransactionRolledbackException: INSERTING AN ALREADY EXISTING BEAN,
      ID = ProductAttrDefaultPK@841839c9; nested exception is: java.lang.IllegalStateException:
      INSERTING AN ALREADY EXISTING BEAN, ID = ProductAttrDefaultPK@841839c9
      java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID = com.ascertech.billingware.
      ejb.entitybeans.ProductAttrDefaultPK@841839c9
      at org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:269)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:161)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:97)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:142)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:103)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:421)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:456)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:237)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)
      at $Proxy111.create(Unknown Source)
      at com.ascertech.billingware.ejb.entitysessionbeans.ESBProductAttrDefaultBean.doAnlegen(ESBProductAttrDefaultBean.java:134)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:504)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)

      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      at $Proxy82.doAnlegen(Unknown Source)
      at SBSAProdukteBean.BWT_SAAttributes(SBSAProdukteBean.java:451)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:504)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)

      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      at $Proxy69.BWT_SAAttributes(Unknown Source)
      at com.ascertech.billingware.guiserver.SAProdukteEdit.doUebernehmen(SAProdukteEdit.java:303)

      at java.lang.reflect.Method.invoke(Native Method)
      at WorkflowObject.doIt(WorkflowObject.java:210)
      at BWGUIServer.solveXMLCommand(BWGUIServer.java:395)
      at BWGUIServer.doPost(BWGUIServer.java:178)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      at org.apache.tomcat.core.Handler.service(Handler.java:287)
      at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      at java.lang.Thread.run(Unknown Source)

      The exception only occur during the inserting if you first delete the same data record and second you will insert the data record with some modifications again. The problem is the identity primary key field object.