Multiple pools/datasources  
HiFi Wed Oct 07 15:40:44 BST 2009
 
Hi,

Thanks a lot for the good pool :-)
I have a question about defining several pools. What I mean, our application uses 3 different databases and obviously needs 3 different pools.
What I'm wondering is how to do it:

Whether I have to define 3 -s in server.xml (Tomcat 6) and then 3 in the app's context.xml. Each has it's own primroseConfigFile which contains setting only for that DataSource

OR

I can define only one in server.xml with primroseConfigFile in which there are 3 different pool definitions.

The DataSource-es are accessed via JNDI. I had success with the first approach, but I'm interesting in the second one too :)

Again thanks for the elegant pool
Regards
 
HiFi Wed Oct 07 15:43:43 BST 2009
 
Sorry, HTML tags.... These are the cases again:

1. Whether I have to define 3 <Resource>-es in server.xml (Tomcat 6) and then 3 <ResourceLink>-s in the app's context.xml. Each has it's own primroseConfigFile which contains setting only for that DataSource

OR

I can define only one <Resource> in server.xml with primroseConfigFile in which there are 3 different pool definitions.
sedj Wed Oct 07 21:22:23 BST 2009
 
Hi,

I'm afraid that due to how Tomcat deals with global JNDI, you have to define the pools in the xml config files. You can dynamically create them if using a container such as Jetty, but with Tomcat, you have to statically define them :(

PS, thanks for the kind comments on primrose :)