Performance + DisconnectedMode

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oodesigns
Posts: 26
Joined: Wed 04 Oct 2006 01:41

Performance + DisconnectedMode

Post by oodesigns » Tue 31 Jul 2007 05:42

Hi

I am trying to use less connections to the database. I turn connection pooling on.

What i do is open a storedprocedure and copying is to a buffer before sending back to the client.

With disconnectedMode on + pooling will it be slower or will pooling of connections keep the speed up.

Whats would be best way of using it.

Connection.Active := True;
Get Storedprocparams
Do procedure
Connection.Active := False
Copy data
DataSet.Close;

All the best

Mike

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 31 Jul 2007 07:37

Disconnected mode with Pooling is useful in the following cases:
- there are several connections in the application;
- database activity of the application is uneven.
These options help to decrease database connections count, with minimum performance loss.

In order to choose the best approach, it is necessary to know structure of the application an conditions in what it will work.

oodesigns
Posts: 26
Joined: Wed 04 Oct 2006 01:41

Post by oodesigns » Tue 31 Jul 2007 12:45

HI

So each storecprocedure object onced opend will release the connection back to the pool?

Mike

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 01 Aug 2007 08:27

Yes, you are right. After the TMSStoredProcedure is executed, and TMSConnection becomes inactive, the connection is put to the pool, but not actually destroyed.
The second execute of the StoredProcedure will not lead to the new connection establishing if the following two conditions are held:
- connection parameters were not changed;
- connection put to the pool is steel alive (see the TMSConnection.PoolingOptions.ConnectionLifetime for more information).
In this case the connection will be taken from the pool.

Post Reply