Intraweb Pool

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wkotze@wccsoft.co.za
Posts: 10
Joined: Wed 20 Apr 2016 21:12

Intraweb Pool

Post by wkotze@wccsoft.co.za » Sun 16 Oct 2016 22:15

Good day.
I am new to Intraweb develoment.
I see there is a pooling option avaiable when creating a new Intraweb projects,
but it does seem to implement a bit more coding to implement pooling option.
Is it possible to rather use the Pooling option in SDAC instead (and leave Intraweb pooling unchecked)?
Thanks you

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Intraweb Pool

Post by azyk » Mon 17 Oct 2016 13:10

You can't use the TMSConnection.Pooling property instead of Pool Data Connections option of IntraWeb applications. This property enables/disables connection pooling to SQL Server in the SDAC: https://www.devart.com/sdac/docs/?devar ... ooling.htm

wkotze@wccsoft.co.za
Posts: 10
Joined: Wed 20 Apr 2016 21:12

Re: Intraweb Pool

Post by wkotze@wccsoft.co.za » Tue 17 Jan 2017 21:24

Hi
After a bit more experience and working in IW I am revisitng this topic. I think sdac pooling option should work seeing that IW will create a seperate thread for each datamodule that contain a tmsconnection.
If tmsconnection is connected with unique value for each connection (ny added "Applicaiton Name="+ "WebApplication.AppID" to connectstring). I am trying to minimize the number of open connections to the database, so i clsoe connection after query on page in done. Is above logic correct?
My question is this. Should I use Disconnected mode or manually disconnect after wach query,
and is there a penalty in setting the maxpool size to high. thank you
Wihan

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Intraweb Pool

Post by azyk » Fri 20 Jan 2017 12:11

Connection Pooling in SDAC.
When using pooling if you call the TMSConnection.Close method, the connection will not be closed, but will be moved into pool for the number of milliseconds specified in TMSConnection.PoolingOptions.ConnectionLifetime. After this time the connection will be closed and removed from the pool if any other TMSConnection does not use it.

When opening a new connection, pool will be checked the first. If a connection with the same connection parameters (including the Application Name option) is found, it will be returned from the pool. Otherwise a new connection will be created.

Connection Pooling + Disconnected Mode in SDAC
.
If a connection is in Disconnected Mode, then after SELECT query execution and all data fetching to the client side, the connection is placed into pool. The TMSConnection.Connected property becomes False, but TMSQuery dataset will remain open and you will be able to edit the data offline, for example using TDBGrid.

If in the described task you are not using offline data editing, then to minimize open connections to SQL Server, it is enough to call the TMSConnection.Close method after SQL queries execution.

Learn more about Disconnected mode in our online documentation: http://www.devart.com/sdac/docs/index.h ... ctmode.htm

Post Reply