1 Reply Latest reply on Apr 4, 2005 7:00 AM by normann

    Wrongful commit by CMP engine?

    normann

      I have a strange problem with the CMP. I can't figure out what is wrong but I have isolated the problem down to this:

      An object (Struts action) invokes a method on one of my stateless session beans. The method invoked has translation attribute "required".

      Besides a lot of read-only operations that performs some checking, the method does the following on an CMP entity bean "order":

      order.setFinalized(false);
       order.setFinalizeTime(null);
       order.setCancelTime(null);
       order.setCancelled(false);
       order.setCancelledForArrears(false);
       order.setCancelBalance(null);
       order.setCloseTime(null);
       order.setEraseTime(null);
       order.setRenewalDate(order.getExpirationDate());
       order.setExpirationDate(null);

      (end of method)

      The entity bean uses local interfaces and is reentrant and all setters have
      translation attribute "required". It uses the JBoss container configuration
      "Standard CMP 2.x EntityBean with cache invalidation".

      Problem: When the transaction above commits, the following SQL is executed:

      UPDATE order_ SET
      renewalDate=null
      finalized='true',
      cancelled='true',
      eraseTime='2005-05-01 15:53:54.986000+02',
      cancelTime='2005-04-01 15:53:54.986000+02',
      cancelBalance=0.0,
      finalizeTime='2005-04-01 15:53:54.987000+02',
      expirationDate='2006-03-02',
      closeTime='2006-03-02 00:00:00.000000+01'
      WHERE id=421498


      (taken from my postgres.log).

      How is that possible? The values are not the ones I requested. Although I'm not sure, the details committed could be the old values of the CMP fields.

      Does anyone have a clue what could be wrong? I sure haven't.

      Best regards,
      Jan Nielsen