I guess it is related to how SEAM handles transactios. I'm using Seam POJOs.
The EntityQuery's getResultSet() method is marked @transactional. Call to getResultSet() commits changes made to Client entity on the jsf form get committed to the database.
Anyone knows why getResultSet() first committed changes to queried Entity. and how I can avoid it in my case?
I guess it's a common issue, I can't find solution since this is my first attempt on such scenarion.
The persistence context is automatically flushed at container invoked method boundaries unless you use flush mode manual.
thanks Pete, yeah I figured that out.
in my case I have a single jsf page. to get my code working, now I specified its scople to conversation; and save the current entity record in page action method, and then use it in update action method to compare if required data columns have been modified by the user.
I am not sure if that is the right way, when wanting to compare user changes with record data in database? but it now works for me.