0 Replies Latest reply on Oct 8, 2004 12:13 PM by jrobette

    Problem with reading data from db while not already commited

    jrobette Newbie


      I'm not sure the title of this question is really clear. So I explain:

      I've a Postgresql DB configured this way :


      In my application, I do the following :

      1 : get a connection from datasource (xxxDS)
      2 : insert some data in the database
      3 : put a message in a queue
      4 : release the connection

      Then another application do the following :

      5 : get the message from the queue (MDB)
      6 : get a connection from datasource (xxxDS)
      7 : call a stored procedure in the database
      8 : get the results
      9 : release the connection
      10 : etc...

      My problem is that I get an error 50% of the time.
      It is due to :
      the stored procedure does not find the data which should have just been inserted.

      So, I conclude that it is a problem of transaction. The first connection has not yet commited while the second is already performing.

      Am I right with this conclusion?
      What should I do then to get it work?
      Maybe, I should force the commit but how (commit() is forbidden : "You cannot commit during a managed transaction!")?

      Thanks a lot!