tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat DBCP Connection pool issue
Date Wed, 27 Jun 2012 15:05:04 GMT
Hash: SHA1


On 6/26/12 7:24 PM, Kiran Badi wrote:
> <Resource name="jdbc/mysitedb" auth="Container" 
> type="javax.sql.DataSource" maxActive="100" maxIdle="30"
> maxWait="10000"

100 active db connections sounds like a lot. Do you really need to
support 100 simultaneous connections to your database? Can your
database support that many connections with active queries from each?
Do you have a cluster? Remember that each member in the cluster will
therefore open a maximum of 100 connections to your database. 10
cluster members means 1000 simultaneous connections.

> I had a bug in my code  and I was not closing connection, I fixed
> it and now this is working fine.

You should enable "abandoned" detection and logging.

>> an architectural comment: it's probably not a great idea to 
>> obtain a database connection directly from your Servlet. Doing
>> so likely ties your business logic directly to both the servlet
>> API *and* the JDBC API.
>> If you want to switch to some other data source (e.g. a 
>> non-JDBC-supported data source like MongoDB, Cassandra, etc.),
>> then you have to re-write your whole app. If you want to support
>> Websocket, then you have to completely re-write your webapp. If
>> you want to create an Android or Swing-based version, you have to
>> completely re-write your app. See the pattern here?
> I know existing design is somewhat a kind of limitation,but again
> at this point ,its just to hard to implement this change.
> Let me think over this.It will take sometime.

There's no time like the present: this problem will only get worse
over time.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


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

View raw message