Friday, February 25, 2011

Re: RequestFactory entity values updated before merge called

JPA provides two modes of flushing query objects namely AUTO and COMMIT (which are defined in FlushModeType Enumeration). If the AUTO mode is set on the Query object which is the default one, then any changes made to entity objects will be reflected the very next time when a select query is made. That means that the persistence engine must make sure to update all the states of the entity objects which will affect the results of a SELECT query.

Then when you do a find(entityToUpdate.getId) probably hibernate flush your changes.

Juan
2011/2/25 opn <opencow@gmx.net>
Hello everybody!

I've got a problem:
I'm using Hibernate version 3.6 and RequestFactory together to manage
all the database work. Until now i did not run into any problems.
But now I've got the case that I want to update an entity (merge), but
need access to the old values of the entity in the update method.
I realized, surprisingly, that when i do a find(entityToUpdate.getId)
within the update method i already get the new values, although i did
not call flush, merge, persist or anything like that.

Does the RF something when i'm sending a proxy over the wire to
explain this behaviour or is it because of my Hibernate settings.

I've got to admit that i am not an expert in Hibernate, but until now
i could do everything i need to.

Thanks for any advice!

Regards

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment