Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

When using the .net data provider one can use connection pooling and provide also a max number of pooled connections. But how to define a timeout for the pooled connections (Version is

Scenario is: at start the application is using 20 connections, but 10 of these will never be reused. My observation is, that these 10 are kept open nevertheless as long as the application runs. Does any setting exsist to limit the life time of an inactive connection in the pool, or have I been just not patient enough to see the timeout?

asked 05 Nov '10, 08:41

Martin's gravatar image

accept rate: 14%

Comment Text Removed
Comment Text Removed
Comment Text Removed
Comment Text Removed

Idle connection parameter is helping and -ti server parameter is helping too. Breck you should change your comment to become an answer, so that I can accept it.

(05 Nov '10, 15:21) Martin

OK... I need points for more bounties :)

(05 Nov '10, 16:19) Breck Carter

permanent link

answered 05 Nov '10, 16:18

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

Note that the -ti (idle timeout) and tl (liveness timeout) do determine when the server and/or client will automatically drop the connection but in this case it would be better to use Minghai's suggestion of using .Net's connection parameter 'connection lifetime' to tell .Net to drop idle connections. Doing so will ensure that the connections are closed 'nicely' rather than having the connections dropped from underneath .Net's feet (so-to-speak).

(06 Nov '10, 00:02) Mark Culp

You should use the 'connection lifetime' parameter which specifies how long the connection will stay in the pool ( in seconds ).The default is 0 which means the connection will stay forever. The only time the provider checks the lifetime of a connection is when the connection is closed.

permanent link

answered 05 Nov '10, 14:22

Minghai's gravatar image

accept rate: 0%

Does that affect how long SQL Anywhere keeps the underlying database connection open? Somehow, I think not:

(05 Nov '10, 14:34) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 05 Nov '10, 08:41

question was seen: 4,521 times

last updated: 05 Nov '10, 16:18