-
1. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
juhalindfors May 24, 2003 4:18 PM (in response to shortpasta)deploy your bean twice under different jndi names and map the ejb names to different datasources in jbosscmp-jdbc.xml
-
2. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
shortpasta May 27, 2003 1:02 AM (in response to shortpasta)my app only needs to run against 1 database, either mysql OR mssql.
when someone installs my app, the installer CAN setup the app for a given database, by deploying the mssql-version of my jar instead of the mysql-version.
i wish there were a way to deploy one jar somehow with many jbosscmp-jdbc.xml, setup for all databases, similar to the Resource Bundle concept:
resource_en is for english
resource_es is for spanish
... and so forth... they're all deployed together, and the app-server picks the right one at runtime in function of the browser's preferred locales. -
3. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
juhalindfors May 28, 2003 5:51 AM (in response to shortpasta)so how would the app server choose which database configuration to use?
-
4. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
shortpasta Jun 3, 2003 8:06 PM (in response to shortpasta)it would be intrinsic in the deployment:
the app-server would knows only about 1 datasource.
i would accomplish this by deploying only 1 of:
mysql-ds.xml
-or-
mssql-ds.xml
both bound to "java:/DefaultDS". -
5. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
juhalindfors Jun 4, 2003 7:03 AM (in response to shortpasta)I'm not sure I'd like that type of implicit behavior -- would seem it is far too easy to connect to the WRONG database and do some damage there.
I rather explicitly bound my datasources to specific names other than DefaultDS. -
6. Re: 1 jar, 2 databases, jbosscmp-jdbc.xml?
shortpasta Jun 7, 2003 3:54 PM (in response to shortpasta)Not at all from my point of view:
remember that my system has to connect to 1 database, either mysql -or- mssql. in this situation the uniform datasource name allows me to deploy both datasource descriptors, and even if a configuration mistake is made one of the datasources will fail indicating that the jndi name is already in use.
furthermore i deploy the datasources with generic db name/username/password, so the chance of anybody in the world picking my same combination is nil.
but my issue is not how to deploy the datasources, it is on howto deploy the ejb modules that contain jbosscmp-jdbc.xml in a similar fashion.
if noone has any better approach i will deploy 2 jars: each with a jbosscmp-jdbc.xml for that specific database. i only wish that there was a way i didn't have to create a full jar that way, after all the only difference is the 1 xml file (unless some surprise comes later).