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 chuck.caldar...@unisys.com
Date: Tue, 31 Mar 2009 22:44:32 -0500
To: users@tomcat.apache.org
Subject: RE: Connection Pooling questions


> From: allen.ir...@smartintegration.com.au
> [mailto:allen.ir...@smartintegration.com.au]
> Subject: RE: Connection Pooling questions
> 
>   <Resource name="jdbc/AttunitySProcDS" auth="Container"
>             type="javax.sql.DataSource"
>             driverClassName="com.attunity.jdbc.NvDriver"
> url="jdbc:attconnect://10.20.5.107:7777/baynav;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:

  removeAbandoned="true"
  removeAbandonedTimeout="60"
  logAbandoned="true"

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
appropriate.

> 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


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



--------------------------------------------------------------------
mail2web.com – What can On Demand Business Solutions do for you?
http://link.mail2web.com/Business/SharePoint



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to