users@glassfish.java.net

Re: global persistence unit?

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Tue, 16 Aug 2011 18:34:16 +0530

Shared persistence units are supported if you use OSGi application
model. See section section #8.1 of [1] or check out the sample available
at [2].

Sahoo

[1] http://glassfish.java.net/public/GF-OSGi-Features.pdf
[2]
http://java.net/projects/glassfish/sources/svn/show/trunk/fighterfish/sample/sample.uas/

On Tuesday 16 August 2011 06:17 PM, Lars Fischer wrote:
> Hello,
>
> I would like to share ONE persistence unit in different applications.
>
> So I have one .ear containing a persistence unit configured with
> transaction-type="JTA" and a jta-data-source.
>
> A second .ear should use this PU by @PersistenceContext, but the EM
> could not be found. I tried different JNDI paths, but all failed.
> All applications run in the same domain.
>
> Is there a restriction on GlassFish (v3.1.1) that prevents accessing
> the PU of an other application?
>
> Regards,
> Lars