tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject RE: Connection Pooling questions
Date Wed, 01 Apr 2009 03:58:29 GMT

Sorry, I included an older context.xml than the one I've been testing with.
That one has 30 for maxActive (everything else is the same).

Thank you very much for your replies Chuck, I think you gave me plenty to
think about and play with to resolve my problem.  Thanks again!

Original Message:
From: Caldarale, Charles R
Date: Tue, 31 Mar 2009 22:44:32 -0500
Subject: RE: Connection Pooling questions

> From:
> []
> Subject: RE: Connection Pooling questions
>   <Resource name="jdbc/AttunitySProcDS" auth="Container"
>             type="javax.sql.DataSource"
>             driverClassName="com.attunity.jdbc.NvDriver"
> url="jdbc:attconnect://;DefTdpName=webdemo"
>             maxActive="50" maxIdle="10"/>

You said maxActive was 30, but it's 50 in your config.  I've never used the
Attunity drivers, but the above looks ok as far as I can tell; perhaps
someone else might see a problem.  You might want to consider adding these:


That will tell you if the pool thinks you're returning connections or not. 
Change the timeout setting (in seconds) to whatever you think is

> so you're saying that the pool will never close any of the connections
> due to them not being used?

Correct; that's normally left up to the database.

> Here's the block I use:
> 		finally
> 		{
> 			// cleanup
> 			if (cs != null) cs.close();
> 			if (conn != null) conn.close();
> 		}
> Where cs = the statement.

If the cs.close() throws an exception, you won't close the connection.  Do
you only ever have one statement per connection?  And depending on the
location of the finally block relative to the rest of the code, you might
not even go through there.

> I don't close the result set as closing the
> statement is supposed to do that.

Regardless, it's good practice to clean up DB resources explicitly,
preferably as soon as you're done with them.

> Maybe this timeout value is what I'm looking for?

Depends on what you want; for a production environment, you never want the
connections to close.  They're cheap to keep around but expensive to create.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail and
its attachments from all computers.

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

-------------------------------------------------------------------- – What can On Demand Business Solutions do for you?

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

View raw message