users@glassfish.java.net

Re: PostLoad life cycle callbacks for Entities invoked twice

From: <glassfish_at_javadesktop.org>
Date: Thu, 17 Jan 2008 13:21:44 PST

There is no easy way to detect it from within the event. I recommend filing a bug.

In the meantime you can add a transient attribute to your object to determine if you have already applied the modification.

You may be able to perform a JNDI lookup for the entitymanager within the event and if em.contains(this) returns true then apply your modification otherwise do not.

--Gordon
[Message sent by forum member 'gyorke' (gyorke)]

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