users@glassfish.java.net

Re: CDI broken between EJB and JPA modules

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 09 Apr 2010 08:36:17 +0530

Witold Szczerba wrote:
> The other thing is, in my EAR, there are many EJB modules and they all
> share common persistence unit which is defined in separate JAR, so I
> wouldn't merge EJB module and JPA together. Such a merge would make
> persistence unit local to that EJB module alone and no other modules
> (be it EJBs or WARs) would have access to it.
>
>
True. That's why it is recommended to have entities.jar along with
persistence.xml under lib dir of the ear. Dan had it on top level.
Having in top level would work, but you will have sharing issues. I
understand that there appears to be some issues with CDI in this way.
Let's investigate that.

Sahoo