users@glassfish.java.net

Re: JPA design question

From: <glassfish_at_javadesktop.org>
Date: Sun, 11 Jan 2009 09:08:42 PST

In section 3.5 of the Java Persistence API, it spell out what a Lifecycle callback can do:

    Lifecycle callbacks can invoke JNDI, JDBC, JMS, and enterprise beans

    In general, portable applications should not invoke EntityManager or Query operations,
    access other entity instances, or modify relationships in a lifecycle callback method.[19

So it seems that if I were to put a @PreRemove lifecycle callback on the reference entities, within that callback, I cannot modify the first entity to update it to remove its references to the entity being removed. Is my understanding correct?
[Message sent by forum member 'bbergquist' (bbergquist)]

http://forums.java.net/jive/thread.jspa?messageID=325243