0 Replies Latest reply on May 4, 2005 12:27 PM by Stefano Gallina

    Using a SELECT after an INSERT into a Session ! Pretty inter

    Stefano Gallina Newbie

      Hi all,

      i have the following situation.
      I call a method of INSERT, using an Entity CMP Bean, inside a method of a Session Bean.
      In the same metod i execute a SELECT query.
      To execute the SELECT query i get a Connection from the container.
      After the execution of the query i notice that i don't have the record whichi have insert before the SELECT.
      Probably because the transaction is not terminated yet.....so how can i do to get the value just inserted ?
      I repeat :

      Method of the SESSION BEAN

      - INSERT with an Entity

      - GET a Connection

      - EXECUTE a SELECT

      - CLOSE THE CONNECTION

      Close of the method of the SESSION BEAN

      Is it a good solution to use the EJB query LANGUAGE with the Entity instead of execute a SELECT query ?
      Cheers.

      Stefano