The current jboss connection pools don't support this. Why would you want this? The connections aren't going to be interchangeable, so I don't really see the point in putting them in a single pool. Please explain.
Wath I want to do is to deploy a set of .ears, each possilbly containing more that one bean. I regard all these .ears for a component and each component has its own set of tables to manage. So, I use a datasource with the same name of the component like:
But as im writing this, i realize that I can trick this when deploying the ejb. But im pretty shure that at least weblogic and sun one can to this.
If all the tables are in the same database, use the same pool for all the ejbs. You can use resource-refs to give each bean its appropriate local datasource name in the java:/comp/env space, but map these all to the same global jndi java:/realdatasourcename.
What additional useful functionality would you get from having connections from multiple datasources in the same pool?
What if you wanted to have one JBoss server connect to multiple datasource depending on the user? Think of a data center hosting may different company/users environments.
How would you setup the environment so that one instance of the server can host multiple users that use different databases?
Then, if this could successfully be done, you can cluster the JBoss servers to use multiple datasources, thus improving performance, scalability, etc.
David, how do I perform the mapping of a resource-ref in my web.xml file (that I don't want to change because my code uses it) to an existing data source specified in jboss. Let's say for example that I want to map the resource:
to a datasource named java:DataSource?
In websphere (which I'm more familiar), I do this association at deployment.
From the Jboss 3.0 docs on page 93 and 103/106. I suppose it's the jboss-web.xml that I need to bundle with web.xml in the WEB-INF directory of the war? Can someone confirm this?
That's correct. For ejbs, you perform a similar mapping in jboss.xml