Subject Still confused about ISAPI, DisconnectToPool etc
Author Paul Hope
I periodically come back to this and can't quite get a clear picture - so
some assistance would be much appreciated :-)

I'll just ramble on a bit in the hope that I raise points I might get a
response to....

Jason has provided DisconnectToPool which allows new connections to come
from an existing pool (or makes a new one if the pool is dry) and throws
used ones back in the pool.

From what I can gather from some experiments the initialization on the dll
happens only once so this is an oportunity to create some global things.

In a standard ISAPI like the IBO demo, when a web action is called, an
instance of the web unit is created (along with any IBO components placed on
it) - this will create a session,connection etc.

If another web action follows it appears to use the same instance - so that
instance stays in memory until the dll is unloaded?

If two or more web actions occur at the same time multiple instances of the
unit appear to be created and presumably stay in memory? Or maybe the
operating system flushes them out after a time?

If the connections connect when the instance of the web module is created
then there will be as many permanent connections to the database as
instances of the web module in memory - doesn't seem a good idea - although
connection overheads will be minimal.

If I connect and disconnect in each action then there won't be any permanent
connections but the overhead will be considerable.

So where does connection pooling come in? For the pool to be available to
any new instance of the web module it would have to be created in global
memory. Each action would then apply for an existing connection and would
be handed one from the pool or have one created for it. After a time unused
connections would be flushed out.

If this is the magic of DisconnectToPool then how is the pool created and
how do the actions obtain a connection from it? Wouldn't I need a Pool
component that is created at initialization, and wouldn't this component
need a GetConnection method that the actions could use?

Help very much appreciated