users@glassfish.java.net

Re: JNDI per cluster vs domain (WLS to GF conversion)

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Mar 2009 17:32:11 PDT

Brian,

I think this is the name-space collision issue which can be worked around. I will get back with
the work-around, but before that I need to understand the problem a little better.

A fact you should know is that in a given domain, you can't create two or more resources of
any kind [b]with the same JNDI-name[/b]. Thus, following is not possible:

<domain>
<resources>
  <jdbc-resource jndi-name="jdbc/mysql" pool-name="mysql-dev"/>
  <jdbc-resource jndi-name="jdbc/mysql" pool-name="mysql-prod"/>
</resources>
<clusters>
  <cluster id="dev-cluster">
    <resource-ref ref="jdbc/mysql"> <!-- should go to mysql-dev -->
   ...
  </cluster>
  <cluster id="prod-cluster">
    <resource-ref ref="jdbc/mysql"> <!-- should go to mysql-prod -->
   ...
  </cluster>
<domain>

Since all the application code (deployed on both dev-cluster and prod-cluster) will
look up the same name [b]("jdbc/mysql")[/b], but want to reach different data-source this
does not work without code-changes.

Is the above a correct characterization of the problem you're seeing?

Regards,
Kedar
[Message sent by forum member 'km' (km)]

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