users@glassfish.java.net

GF 3.1 & non-standard jndi names

From: <forums_at_java.net>
Date: Thu, 31 Mar 2011 15:02:16 -0500 (CDT)

Hello,

I understand that , as per the EE 6 spec, a datasource defined should have a
jndi name in the java:app/ or java:module/ scope.

[code] <jdbc-resource pool-name="myDS"  jndi-name="java:app/jdbc/myDS"  />
      <jdbc-connection-pool name="myDS"
           
datasource-classname="oracle.jdbc.pool.OracleDataSource"
            res-type="javax.sql.DataSource" >
          <property name="password" value="xxx"/>
          <property name="url" value="xxx"/>
          <property name="user" value="xxx"/>
      </jdbc-connection-pool>[/code]

Now, it is possible to make a datasource available at java:/jdbc/myDS?
I thought that this would do the trick:

 [code] <jdbc-resource pool-name="myDS"  jndi-name="java:jdbc/myDS"  />
      <jdbc-connection-pool name="myDS"
            allow-non-component-callers="true"
            datasource-classname="oracle.jdbc.pool.OracleDataSource"
            res-type="javax.sql.DataSource" >
          <property name="password" value="xxx"/>
          <property name="url" value="xxx"/>
          <property name="user" value="xxx"/>
      </jdbc-connection-pool>[/code]

 But when I declare by persistence unit:

[code]<persistence-unit name="myPU" transaction-type="JTA">
       <jta-data-source>java:jdbc/myDS</jta-data-source>
...</persistence-unit>[/code]

Glassfish tries to lookup java:jdbc/myDS__pm, which it does not find.

I tried to declare the DS as:

[code] <jdbc-resource pool-name="myDS"  jndi-name="java:jdbc/myDS__pm" 
/>[/code]

but it didn't work either.

Is it even possible give a DS  a jndi name in the java:/jdbc scope?

 

Thanks.

 


--
[Message sent by forum member 'vincenta']
View Post: http://forums.java.net/node/787436