You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gibson Brad - IL <GI...@tusc.com> on 2002/05/09 07:13:11 UTC

Struts Datasources

If I define more than one Datasource using Struts, how do I have to refer to
each at the code level?
 
Do I do something like:
 
DataSource dsOne = getDataSource( "defaultDB" );
DataSource dsTwo = getDataSource( "myOtherDB" );
 
Or, can I mark one of my DataSources as default, so if I'm looking for my
most-oft-used DS I can just say:
 
DataSource dsOne = getDataSource();
 
I'm also curious to know how pooled connections are recycled/closed after
they haven't been used for a while.  For instance, during a peak period I
may max-out my connections at 100, but then I require only 10 connections
during off-peak periods.  Do DataSource objects, by definition via the spec
(or otherwise), close those 90 unneeded connections during off-peak periods?
 
 
Brad Gibson