users@glassfish.java.net

Re: PostLoad life cycle callbacks for Entities invoked twice

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Sep 2008 08:52:53 PDT

Hi,
I have the same issue that I'm trying to solve for 2 days.
Actually, I need to make some generic conversion of my entity's fields, for all mapped entities. Doing the conversion twice, is not good.
The transient solution doesn't work. The entity object is not the same across the two calls. Although my fields are modified from the 1st call to the second, my transient variable has always the same default value.
I cannot get my contained EntityManager. This is another issue, but my EntityListener class is not an EJB, so injection doesn't work and all that I've tried with JNDI, neither. The best was some :

new InitialContext().lookup("persistence/mydb")

wich throwed some kind of CommunicationException.

So, I'm stucked, did you people found another solution?
[Message sent by forum member 'rjuncu' (rjuncu)]

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