0 Replies Latest reply on Oct 11, 2004 5:11 PM by Chris Lamprecht

    MDB not seeing entity created in SLSB - using IPT

    Chris Lamprecht Newbie

      I'm having the following problem, using CMP (and instance per transaction config):

      In a stateless session bean:
      1. Create a new CMP entity
      2. Send a JMS message containing the new entity's PK
      In the MDB:
      3. The MDB receives the JMS message (onMessage is invoked)
      4. And it does a findByPrimaryKey() on the newly-created entity
      5. Gets an "ObjectNotFoundException: No such entity!"

      I recently changed to Instance Per Transaction configuration for performance reasons. My guess is that the MDB is being invoked before the session bean transaction finishes, and so it's not able to see the newly-created object (since it hasn't been committed yet). Can someone verify if this is correct or not?

      And in any case, what are the preferred ways to get around this problem? Thanks