On 30/04/2013 12:59, Jose María Zaragoza wrote: > Hello: > > I'm using Tomcat 6.0.23 > I'm using DBCP library to pooling database connections. > > When I define a <Resource> in context.xml > and set maxWait to 2000 ms , > sometimes datasource.getConnection() method lasts 15 seconds. > > I've to define loginTimeout parameter in JDBC driver to get the effect that > I want : a timeout retrieving a Connection > > What is the meaning of maxWait ? When is triggered this timeout (maxWait) ?
maxWait is the maximum time DBCP will wait for a connection to become available if the pool is at full capacity (i.e. all permitted connections have been created and are currently allocated to other clients). In your case, no connection is available and there is still spare capacity in the pool so a new connection is created. That will take as long as it takes. Tomcat & DBCP have no control over it. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org