I realize that I'm not giving enough information right now for you to actually 
DO what I suggest, but I might be able to help with some details if you are 
interested in this approach.

In JBoss, you can use XML files in the \deploy directory to declare 
datasources, for example, a file called mysql-ds.xml might contain the 
following:
<datasources>
  |   <local-tx-datasource>
  |     <jndi-name>MySqlDS</jndi-name>
  |     <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
  |     <driver-class>org.gjt.mm.mysql.Driver</driver-class>
  |     <user-name>root</user-name>
  |     <password></password>
  |   </local-tx-datasource>
  | </datasources>
  | 
This file declares a My SQL database called "test" and gives it a JNDI name of 
"MySqlDS".  

It seems to me that you could create two files like this one.  Each file would 
declare a different datasource and associate a different JNDI name.  I think 
you might even be able to declare BOTH in the same file as there is a 
"datasources" node but I'd have to check on that.

Anyway, if you have 2 datasources each with different JNDI names, you could use 
two copies of your EAR, each referring to the different datasource's JNDI names.

The question you asked about using different context roots doesn't seem to 
solve the problem of using different databases.  Declaring different 
datasources with different JNDI names might.

Does this approach sound interesting to you?

Spoon

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873153#3873153

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873153


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to