Page 1 of 1

Performance + DisconnectedMode

Posted: Tue 31 Jul 2007 05:42
by oodesigns
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

Posted: Tue 31 Jul 2007 07:37
by Antaeus
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.

Posted: Tue 31 Jul 2007 12:45
by oodesigns
HI

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

Mike

Posted: Wed 01 Aug 2007 08:27
by Antaeus
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.