users@glassfish.java.net

GF/Hibernate save without calling save explicitely?

From: <forums_at_java.net>
Date: Tue, 22 Nov 2011 12:43:57 -0600 (CST)

Hi guys,

I am using GF 2 and container managed persistence with Hibernate 3.2 as
provider. I have some finder method in my business logic, which manipulates
some persistent entities, which have been fetched via the EntityManager. The
manipulation is just changing a String property (deleting an element from a
collection leads to the same effect). I do not call anything like save or
persist on my EntityManager. I just want to return some changed entities to
my client.

It seems when the container commits the transaction the changes to my entity
are saved automatically. Is there some magic Hibernate or Glassfish behaviour
I missed completely so far?

Michael


--
[Message sent by forum member 'ztangm']
View Post: http://forums.java.net/node/867101