Page 1 of 1

Connection Pooling with Unidac and SQLServer

Posted: Sat 03 Jun 2017 21:17
by andresantos78
Dear
Team Support!

Using Delphi Tokyo, Unidac 7.0.2 and SQLServer for the 3 Layer Environment (DataSnap).

How do I enable a connection pool?

When I use ADO this feature is already enabled by default on the database client.

Is it possible to use this feature with the Devart / Unidac components?
Is there any example or documentation?

I await a return and thank you for your attention.

Best Regards,

André Santos

Re: Connection Pooling with Unidac and SQLServer

Posted: Tue 06 Jun 2017 08:49
by azyk
In order for UniDAC to use connection pooling, set TUniConnection.Pooling to True. When using pooling, and you call the TUniConnection.Close method, the connection won't be closed, but it will be placed to pool for a number of milliseconds specified in TUniConnection.PoolingOptions.ConnectionLifetime. After this time passes, the connection will be closed an removed from the pool if any other TMSConnection does not use it.

When opening a new connection, the pool will be checked first. If a connection is found with the same parameters in the pool, it will be returned from the pool. Otherwise, a new connection will be created.

More details about UniDAC Connection Pooling in our online documentation:
https://www.devart.com/unidac/docs/inde ... ooling.htm