From: Steve E. (JIRA) <no...@at...> - 2006-05-24 16:29:25
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-183?page=all ] Steve Ebersole reassigned EJB-183: ---------------------------------- Assign To: Steve Ebersole > EntityManager.remove should be a noop on new/transient entities > --------------------------------------------------------------- > > Key: EJB-183 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-183 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Java 1.5.06, hibernate 3.2.CR2, entity manager 3.2.CR1, annotation 3.2.CR1 > Reporter: Rob Hughes > Assignee: Steve Ebersole > > > According to section 3.2.2 of the ejb persistence spec the following code should be a noop: > EntityManager em = Persistence.createEntityManagerFactory("manager").createEntityManager(); > SomeEntity entity = new SomeEntity(); > em.getTransaction().begin(); > em.remove(entity); > em.getTransaction().commit(); > This is throwing a TransientObjectException wrapped in a PersistenceException. > I looked at patching AbstractEntityManagerImpl.remove to specifically ignore TransientObjectException but that wouldn't allow the delete operation to be cascaded downward as the cascading in DefaultDeleteEventListener.onDelete is after the transient object check. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |