Hi Jarkko,

thanks for the help. Unfortunately this didn't work. Even when I separated out the mysql file what seemed to happen was both ears used one database. I tested each application on its own (removing the other ear) and they both worked fine. I think what was happening was they were using whichever datasource was loaded first.

I fixed the problem by adding a jboss-app.xml file and adding the following lines:

<jboss-app>
 <loader-repository>appname:loader=dell</loader-repository>
</jboss-app>

<jboss-app>
 <loader-repository>appname:loader=microsoft</loader-repository>
</jboss-app>

I think this gives each ear a separate class loader, but I'm not sure.

It finally worked for me under this configuration.

thanks for the help,
Brian

From: Jarkko Lietolahti <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Two datasources, almost working...
Date: Thu, 04 Dec 2003 05:39:54 +0200

Hello,
Try separating the datasource definitions into two different ds.xml-files (dell-mysql-ds and microsoft-mysql-ds.xml). This also gives you the ability to deploy/undeploy only needed datasources..


t. Jarkko

Brian Styles wrote:

Hi all,

In my effort to deploy two versions of my ear on the same jboss3.2.2 under different virtual hosts, I'm left with one little problem. Try as I might, my two applications are using the one datasource.

For examples sake, lets say the two versions of the applications are for two different companies: dell and microsoft

I'm using mysql and have created two datasources in my mysql-ds.xml file

<datasources>
 <local-tx-datasource>
   <jndi-name>dellDS</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/dell</connection-url>
   <driver-class>com.mysql.jdbc.Driver</driver-class>
   <user-name>jboss</user-name>
   <password>whatever</password>
 </local-tx-datasource>

 <local-tx-datasource>
   <jndi-name>microsoftDS</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/microsoft</connection-url>
   <driver-class>com.mysql.jdbc.Driver</driver-class>
   <user-name>jboss</user-name>
   <password>whatever2</password>
 </local-tx-datasource>

</datasources>

and the references in my ejb jars do correspond correctly to these jndi names.
And when I check the jmx-console, under jboss.jca I get


name=dellDS,service=LocalTxCM
name=dellDS,service=ManagedConnectionFactory
name=dellDS,service=ManagedConnectionPool
name=microsoftDS,service=LocalTxCM
name=microsoftDS,service=ManagedConnectionFactory
name=microsoftDS,service=ManagedConnectionPool

but under jboss.management.local

I only see:

J2EEServer=Local,JCAResource=microsoftDS,j2eeType=JCAConnectionFactory,name=microsoftDS

Wrapper,j2eeType=JCAResource,name=microsoftDS
J2EEServer=Local,j2eeType=JCAManagedConnectionFactory,name=microsoftDS

but no corresponding entries for dellDS

Both applications are successfully using micrsoftDS

and I think that maybe this might be because of the lack of the stuff in jboss.management.local above.

Please can anyone help me?

thanks very much,

Brian

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail




-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user





------------------------------------------------------- This SF.net email is sponsored by OSDN's Audience Survey. Help shape OSDN's sites and tell us what you think. Take this five minute survey and you could win a $250 Gift Certificate. http://www.wrgsurveys.com/2003/osdntech03.php?site=8 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail




-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to