Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0
i am implementing a (struts) webapp where, for update, i
1. get the form from struts
2. move the values into a transfer object
3. give spring the transfer object.
in the spring layer i:
1. fetch the original data object from the hibernate-dao layer (using load)
2. update the values from the transfer object that have been changed
i then give the data object back to the dao, and call update there, and i am done.
but ... my record doesn't get updated. from what i can tell, hibernate has a look at the object i gave it (which is a proxy), then checks to see if it already has one of these in it's cache. it does, so out goes mine, and update is called with the old one (which, of course, doesn't have the updates). i don't see why my proxy is not the one already in the session cache.
if i leave off my fetch of the original data object and just build a new data object from scratch, the update works fine. the problem there is that i don't push all the data out to the form (e.g. created-by metadata), so i need to have that somewhere (i tested this by putting/getting the transfer object in my http session).
questions: is there something else i should be doing? is my pattern itself flawed? is there a better way to do this? is this a spring thing?