Hello all,
I have a scenario and I can't seem to make heads or tails of it.
I have a web app that uses hibernate
I work in a predominately SQL shop where they use PL/SQL so I am a bit of an anomaly here but thats life
I have a java stored proc that POSTS to my web app
the business logic here is mostly in PL/SQL so there is a PL/SQL proc that uses my java stored proc
I write an object to hibernate, call commit explicitly and send back the ID
the stored proc "SOMETIMES" can't find this record by the ID I just returned
the data is there because we don't find out until the next day and I can see that it is in the table
the only scenario I see that makes sense is that the commit didn't happen immediately so when the stored proc queries it is in fact not there
Everywhere I read states that Session.flush() is called from Transaction.commit() so I shouldn't need to explicitly call it and I don't
I also read that commit should synchronize the database immediately but that doesn't seem to be as immediate as I would like
Am I missing something??
Does the synchronize take a bit of time to execute and is it asynchronous?
Thanks in advance
Brian
|