You can create an object, set Id, and other properties on your own, and save it without worrying about the Hibernate Session exception.If you’re using save Or Update, the object saved MUST be attached to session. This means you can create a copy of object from Service layer and just pass the object to your DAO.primary key if saving a new object) Object merge(object)- object does not have to be attached to a hibernate session.Once save/update is done, the object DOES NOT reflect the change.
The // in the first session Cat cat = (Cat) first Session.
hibernate template save and saveorupdate problems Hi I've gotten my spring application to work. I tried adding a new entity to the database (Hibernate) using get Hibernate Template()Or Update(splash); but if I ...
Hibernate - save Or Update problem Hy, I'm using Hibernate 2.1.6 and Spring 1.1.0.
This can be very tedious issue, since that means if you need to save an object that is not attached to a session, you need to do these.
object must be attached to a hibernate session (including all sub objects within the object), and once save/update is done, the object reflects the updated changes (e.g.