users@glassfish.java.net

Re: How to package Persistence Unit at Application Level

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 18 Feb 2009 23:01:08 +0530

If you will not be accessing the PU from web or ejb, then who uses the
PU and how? Do you use it from an appclient which is packaged in the ear
file? Persistence unit by itself is not an active object. You need to
activate it from an ejb or web or appclient. Each of them has to declare
persistence-unit-ref in their respective DD or use corresponding
annotations. If you want the PU to be shared by multiple modules in the
ear, then package the PU in the "lib" dir of the ear.

Sahoo

glassfish_at_javadesktop.org wrote:
> I have a persistent unit in an application that runs on the glassfish server. The application does not have any ejbs and will not be accessed through a servlet. I have created a persistence archive but haven't figured out where to put the "persistence-unit-ref" deployment descriptor. I know it can go in the web.xml and the ejb-jar.xml but I will not be accessing the persistence unit through either an ejb or servlet.
>
> How can I get the glassfish server to recognize the persistence unit from the application level instead of ejb or web?
>
> Thanks for your help!
> [Message sent by forum member 'melodyk' (melodyk)]
>
> http://forums.java.net/jive/thread.jspa?messageID=332655
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>