users@glassfish.java.net

Re: Same app twice using JPA

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Jun 2007 12:52:58 PDT

Whether TopLink will work in your scenario or not, will depend on 2 things - your expectations and the class loader.

1. The class loader. In the same class loader, there can be only one PU with a particular name. I think there is an open issue to allow the same name but different overrides as specified in the map that you pass to Persistence.createEMF() call.

2. Expectations. Do you expect those two apps to share a PU or have their own copies? Depending on how Tomcat handles class loaders (GF uses a separate class loader for each application), you'll get a different answer to your original question.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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