kantorn
Sep 24th, 2004, 02:26 AM
Hi.
I'm planning an enterprise application, based on Tomcat, Spring and Hibernate whos core functionality would be this:
A main database (with Spring-Hibernate access layer) store "snapshots" of other databases. Access to these other databases is handled via Spring JDBC setup, and urls, password and so on are stored in a table in the main database. Performance isn't prime concern in querying the external db:s, because querying will take place weekly or so.
Now, the question I have is this: in order to be able to query all these databases for "snapshots" I have to be able to aquire a temporary connection with correct data for the DriverManager. This connection which will be closed after statemants is executed.
Say I choose to use a connection pool like c3p0 for the temporary connection. The "main databse" shouldn't cause any troble, I've used Hibernate w. c3p0 before. But there will have to be a second instance declared, one that supports runtime setup/closure of connections.
First of all, how do you declare this c3p0-pool in a Spring xml?
Secondly; does this c3p0 pool support so to speak random connections, which are acuired at runtime?
Third question: are there any known problems of declaring multiple pools/datasources in one Spring app?
Thank you!
I'm planning an enterprise application, based on Tomcat, Spring and Hibernate whos core functionality would be this:
A main database (with Spring-Hibernate access layer) store "snapshots" of other databases. Access to these other databases is handled via Spring JDBC setup, and urls, password and so on are stored in a table in the main database. Performance isn't prime concern in querying the external db:s, because querying will take place weekly or so.
Now, the question I have is this: in order to be able to query all these databases for "snapshots" I have to be able to aquire a temporary connection with correct data for the DriverManager. This connection which will be closed after statemants is executed.
Say I choose to use a connection pool like c3p0 for the temporary connection. The "main databse" shouldn't cause any troble, I've used Hibernate w. c3p0 before. But there will have to be a second instance declared, one that supports runtime setup/closure of connections.
First of all, how do you declare this c3p0-pool in a Spring xml?
Secondly; does this c3p0 pool support so to speak random connections, which are acuired at runtime?
Third question: are there any known problems of declaring multiple pools/datasources in one Spring app?
Thank you!