Session.Pooling

jedaworks

Member²
Could we get an explanation of how to use internal TOracleSession pooling in an ISAPI dll? Some questions I have are
1) In general how does the TOracleSession pooling work? I've read the help on it, but would like to know some of the internal workings.
2) In an ISAPI dll, should a global TOracleSession be created with the pooling set spInternal, or just create a session for each web session?
3) How many connections are created in the pool?
4) If 100 users connect, then drop off, are there 100 open connections in the pool?
5) Do unused connections time out?
6) Are connections created in batchs? For example if there are 3 in use connections, and a 4th user logs on, how many connections are created? Just one? Or a batch of connections, with all unused except one begin allocated to the new user?
7) Any other general ideas that explain how the pooling mechanism works would be good...
 
1) In general how does the TOracleSession pooling work? I've read the help on it, but would like to know some of the internal workings.

A global SessionPool (this is an actual global variable in the Oracle unit) maintains a list of physical sessions, which will be used and reused by TOracleSessions that connect, if the Pooling property is set to spInternal.

2) In an ISAPI dll, should a global TOracleSession be created with the pooling set spInternal?

No, you should create your TOracleSessions in your data modules as usual, and use the pooling concept to reuse the connection resources.

3) How many connections are created in the pool?

Initially 0. It depends on how many TOracleSessions are concurrently connected.

4) If 100 users connect, then drop off, are there 100 open connections in the pool?

If they all are concurrently connected: Yes.

5) Do unused connections time out?

No, but you can call SessionPool.Compress to disconnect and remove unused sessions. SessionPool.Count indicates the number of sessions in the pool (used and unused).

6) Are connections created in batchs?

No, the SessionPool will create just one session at a time.

7) Any other general ideas that explain how the pooling mechanism works would be good...

I hope the above clarifies things a bit...

------------------
Marco Kalter
Allround Automations
 
Thanks Marco

There does not seem to be any way to compress so there are still a certain number of free connections available. Any way to get the system to compress and leave x number of connections available? The way it is now, you either have the "open connections = max number of connections at any one time" or "compress and have open connections = active users"

Would be nice to have "compress and have open connections = x number of connections" (unless there are more active users than x, in which case active connections = active users)

I see there is a Reserve and a Release method. Can you explain these further?
 
The compress function will indeed remove all unused sessions. There is no way to keep X sessions.

Reserve and Release should not be used directly by an application.

------------------
Marco Kalter
Allround Automations
 
Back
Top