So I have this JS form that creates a new record (MySQL, Struts, Hibernate) via an AJAX request.
Once the record is created, I then return the new ID. At that point, I take that ID and append it to the URL and navigate to an edit screen.
Well, sometimes, I’m getting an IORecordNotFoundException and/or `java.lang.NullPointerException’ errors on the edit screen.
If I give it a second or two, the records loads just fine. The MySQL server is a little busy at about 19.8 commands per second on average.
Any suggestions on how to better handle this issue?
Thanks.
I think you are not committing your hibernate transaction immediately,
the previous transaction is committed only when the next transaction is started.So try explicity committing the transaction.