users@glassfish.java.net

Specifying datasource during deployment of a JPA based application

From: <glassfish_at_javadesktop.org>
Date: Sun, 31 May 2009 08:08:15 PDT

I am looking for a clean way to specify the name of a datasource during deployment of an EAR or WAR to glassfish 2.1.

Using JPA the 'persistence.xml' file could have an entry for jta and non-jta datasource names, along with other specifications (like the class names for entities etc.). But what I [b]don't [/b] want is to un-jar and re-jar my application package, manually editing the persistence.xml file each time I deploy another instance (client's copy) of the application. A clean separation of concerns (or responsibilities/ roles) should leave the application untouched, adding only additional environment information to the deployment plan.

Is there any place where the datasource name can be put outside of the WAR or EAR file and from where glassfish would map it to persistence unit contained in the application?
[Message sent by forum member 'frankwhofmann' (frankwhofmann)]

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