0 Replies Latest reply on Mar 6, 2003 2:16 PM by homerlex

    CMP Entity Bean commit-option problem

      JBoss 3.0.4/ Postgres 7.3

      I have a servlet that updates a table via this bean. I hit the servlet and the row is created just fine. An external application (not using beans) remove the record from the db. I then hit the servlet again - this time when the code does the create() method I get the exception at the end of this message.

      If I hit the servlet again - it goes through fine.

      I tried using commit-option B and C in the standardjboss.xml file(yes, restarting the server each time I changed the options).

      I even tried adding it to the jboss.xml for that bean like this:
      .
      .
      .

      <container-configurations>
      <container-configuration>
      <container-name>Standard CMP 2.x EntityBean</container-name>
      <commit-option>B</commit-option>
      </container-configuration>
      </container-configurations>


      Any idea why its not working on that first hit after the record is removed by the external app?


      14:09:21,009 ERROR [LogInterceptor] RuntimeException:
      java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID = 12345600000000000000000000000000
      at org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:222)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:103)
      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:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)