Hi,

suppose the following code:

@Transactional
public void bar() {
foo();
}

public void foo() {
MyJPAEntity entity = someJPADao.getEntity();
entity.setName("foo");
}


When running this code, would you expect that entity gets persisted / updated? In method "foo", the object entity is a detached instance of MyJPAEntity when coming back from the DAO. And now i really wonder why this detached instance gets "merged" (aka updated) when i leave bar().

I migrated my codebase from Kodo/JDO and there, MyJPAEntity wouldnt have been updated without an explicit re-attach. Any explanations welcome.

---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de




Reply via email to