Hello,
This is happening when ejb service call is made via HttpRequest post method to get Objec A. Once this ejb service is invoked, the control goes to the backend and Object A is retrieved. While in the backend another call is made to query more objects in the same ejb session.
I noticed when the query.list() is called to get more objects, the object A version is getting incremented. So, each time query.list() is executed the version gets updated by 1, therfore, the query.list() is called twice in this case, the version is incremented by 2.
This whole thing is the side effect of implementing interceptor for audting purposes using onFlushDirty(). This causes save errors if the retrieved object is already in the session with the old version.
Any insight will be appreciated.
Thank you!
|