You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Patrick Linskey <pl...@gmail.com> on 2007/06/29 15:02:08 UTC
LifecycleListener problem
Hi,
It is possible to registering a LifecycleListener like so:
emf.addLifecycleListener(new MyLifecycleListener());
However, a listener so registered will never fire, because the
internal code will see a Class[0], not null, as the last argument to
addLifecycleListener(). The right syntax is:
emf.addLifecycleListener(new MyLifecycleListener(), null);
Needless to say, this is a bit surprising. Maybe we should treat
Class[0] as null?
-Patrick
--
Patrick Linskey
202 669 5907
Re: LifecycleListener problem
Posted by Kevin Sutter <kw...@gmail.com>.
Sounds reasonable to me.
On 6/29/07, Patrick Linskey <pl...@gmail.com> wrote:
>
> Hi,
>
> It is possible to registering a LifecycleListener like so:
>
> emf.addLifecycleListener(new MyLifecycleListener());
>
> However, a listener so registered will never fire, because the
> internal code will see a Class[0], not null, as the last argument to
> addLifecycleListener(). The right syntax is:
>
> emf.addLifecycleListener(new MyLifecycleListener(), null);
>
> Needless to say, this is a bit surprising. Maybe we should treat
> Class[0] as null?
>
> -Patrick
>
> --
> Patrick Linskey
> 202 669 5907
>