struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <>
Subject Re: how to config connection time out in struts connectionpool
Date Sat, 02 Aug 2003 12:38:04 GMT
Struts does not so much provide a connection pool as it provides a way
to load and expose one. The Struts data source controller will
instantiate any DataSource subclass you like and then use reflection to
set whatever properties you specify. Since you are using the Commons
DBCP pool, the best place for more information would be the Commons DBCP

The properties the DBCP BasicDataSource accepts are documented here:

However, the idea of a connection time-out does not usually apply to a
connection pool. The idea is that all the connections are shared and
kept in use. A client may use one connection instance for one access and
another connection instance for the next.

The closest corollary may be the number of idle connections allowed.
Here, a pool will start to release idle connections when the number
exceeds your specification.

But, again, this a setting that Struts passes along to the DataSource
instance. Struts itself has no control over the DataSource instance or
its capabilities. It merely exposes a collection of arbitrary
DataSources to your application as a convenience.


Yue Lieji wrote:
> who can tell me how to config the connection time out in a struts 
> connectionpool?
> i config my connectionpool as below.but connection will be exhausted 
> very soon.
> <data-sources>
> <data-source key="testSource" 
> type="org.apache.commons.dbcp.BasicDataSource">
>  <set-property property="driverClassName" 
> value=""/>
>  <set-property property="url" 
> value="jdbc:microsoft:sqlserver://myComputer:1433;DatabaseName=myDB"/>
>  <set-property property="maxActive" value="50"/>
>  <set-property property="maxIdle" value="5"/>
>  <set-property property="username" value="user"/>
>  <set-property property="maxWait" value="5"/>
>  <set-property property="password" value=""/>
> </data-source>
> </data-sources>
> _________________________________________________________________
> 免费下载 MSN Explorer: 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Ted Husted,
  Junit in Action  - <>,
  Struts in Action - <>,
  JSP Site Design  - <>.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message