We are attempting to run
-- two (almost identical) ears
-- on a single instance of JBoss [Zion] 4.0.5.GA
-- using two datasources
-- pointing to two different databases on the same database server.
What happens is that the ear deployed first determines the database used.
In other words, the second ear will connect to the same database as the first
one.
Therefore entity beans of the second-deployed application are connected to the
wrong database.
When run individually, each application connects to the database as defined in
the relevant -ds file.
Details
There are no deployment errors
Both datasources are bound correctly to different JNDI-names and show up
correctly in the JNDI-view under the java: Namespace.
The applications are separated in Global JNDI namespace.
Inspecting the log indicates that there is no classloading issue.
Static code sections work properly also indicate there is no problem with
classloading.
Accessing the datasources directly from each application via
InitialContext.lookup by JNDI also works.
We use two -ds files (putting both datasources into one file made no
difference):
first-ds.xml
| <datasources>
|
| <local-tx-datasource>
| <jndi-name>MySql_FIRST_DS</jndi-name>
| <connection-url>jdbc:mysql://ourHost:3306/firstSchema</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>ourName</user-name>
| <password>ourPassword</password>
| </local-tx-datasource>
|
| </datasources>
|
|
| second-ds.xml
| <datasources>
|
| <local-tx-datasource>
| <jndi-name>MySqlDS</jndi-name>
|
<connection-url>jdbc:mysql://ourHost:3306:3306/secondSchema</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>ourName</user-name>
| <password>ourPassword</password>
| </local-tx-datasource>
|
| </datasources>
|
Any help appreciated. Thank you
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045382#4045382
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045382
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user