users@glassfish.java.net

JNDI datasource names and persistence.xml

From: <glassfish_at_javadesktop.org>
Date: Thu, 06 Aug 2009 21:47:28 PDT

Hi,

Is there a way to define a JNDI DataSource in persistence.xml that isn't vendor specific? In both Glassfish and JBoss I create a DataSource with the JNDI name [b]ItmaDS[/b].

In Glassfish, I need to use this in my persistence.xml:

[code]
<persistence-unit name="ItmaPU">
        <jta-data-source>ItmaDS</jta-data-source>
</persistence-unit>
[/code]

In JBoss I need to use this:

[code]
<persistence-unit name="ItmaPU">
        <jta-data-source>java:ItmaDS</jta-data-source>
</persistence-unit>
[/code]

I must be missing something because it doesn't make sense that I need to change persistence.xml and re-package my app just to deploy to a different app server. What am I doing wrong?
[Message sent by forum member 'jptech' (jptech)]

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