Posted By: Peter Laursen ISAPI, TWebModule and TOracleSession - 08/10/00 03:55 PM
Does anyone here have experience using DOA for databaseacces in an ISAPI application?

I am having trouble with the multithreaded aspect of the webmodule. I place an TOracleSession in the webmodule at designtime and set it as the session property of my TOracleQueries and TOracleDatasets. Now each http-request spawns a new thread of the application with its own session, but the sessions all have the same name, but of course I need to serve webusers in their own databasesession, right?
Now, with a TSession you would use the AutoSessionName property, but TOracleSession does not not have it.

I see two possible solutions: Either use one multithreaded session global to the WebModule and all webusers. Well, thats not really a solution. Or generate singlethreaded TOracleSessions dynamically with unique names and then set the sessionproperty of queries and do that for each http-request!

Is my understanding of this correct?

from the Delphi manual:
Separate instances of the Web module are generated for each thread at runtime. Each of those modules contains the session object. Each of those sessions must have a separate name, so that the threads that handle separate request messages do not interfere with each other's database connections.

Any workarounds?

TIA
Peter Laursen
You are welcome to answer directly to my emailadr:
ptl@edbgruppen.dk
The AutoSessionName applies to the SessionName property of a TSession. The Name of each TSession instance in each WebModule instance will be the same. The BDE apparently requires unique SessionName properties for all TSession instances.

A TOracleSession does not have a SessionName property, and does not require an AutoSessionName property. Multiple TOracleSession instances will never interfere with each other, regardless of their Name. Therefore you should not run into any kind of problem with TOracleSession instances in WebModules.

------------------
Marco Kalter
Allround Automations
© Allround Automations forums