Hibernate saveorupdate is not updating
So far I had been using Save Or Update most of the time, but I am worried it is wrong. I'm using NH in a web application and I was wondering if doing a single Flush just at the end of the page processing would be sufficient or there would be situations where it would cause a problem? I am trying to improve the performance of my stuff and I'd like to learn some best practices at the same time. the object is not associated with the session anymore.
That means it one of three things: the object has been loaded from a different session; you have cleared the session; or you have evicted the object from the session. Use Save Or Update() if you don't know if the object is new or not.
EMPDEPT as EMPDEPT3_0_ from EMPLOYEE employee_ where employee_.
Publication Of course, if I comment out the call to save Or Update(publication), then I get lazy Initialization Exception (if the publication is not yet in either of the Subscribers' Sets).
Subscriber.unsubscribed Publications#4f2252b203194e5a0103195114600001]@4000000042546b350354515c ,053 DEBUG Session Impl:2984 - uninitialized collection: [email protected] ,055 DEBUG Loader:197 - processing result [email protected] ,057 DEBUG Loader:405 - result row:@4000000042546b3503adcf84 ,059 DEBUG String Type:68 - returning '4f2252b203194e5a0103195114600001' as column: [email protected] ,061 DEBUG Loader:292 - found row of collection: [com.wrinkledog.phydeaux.model.
Subscriber.unsubscribed Publications#4f2252b203194e5a0103195114600001]@4000000042546b3503e60624 ,062 DEBUG Session Impl:3007 - reading [email protected] ,064 DEBUG Long Type:68 - returning '4' as column: [email protected] ,067 DEBUG Session Impl:1950 - loading [com.wrinkledog.phydeaux.model.
Associated objects may be made persistent in any order you like unless you have a give you a way to retrieve a persistent instance if you already know its identifier.
One version takes a class object and will load the state into a newly instantiated object.
Can anybody help me work out the solution to this problem?