struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
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
site.

The properties the DBCP BasicDataSource accepts are documented here:

http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html

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.

-Ted.

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="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>  <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:   http://explorer.msn.com/lccn 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org
> 
> 


-- 
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message