Isapi.dll using DOA

roberts12

Member
I've written an isapi web application that uses the DOA components and I have a problem when two or more users access the same query simultaneously. One is successful while the others fail. This is an app that I've converted from ms/sql bde and to get around the issue with it I had to create multiple sessions directories. I'm not sure how I get around the problem with your components.
 
Hy,

Your ISAPI-dll starts an new thread for each reques, the server gets. If two different threads are using the same query-instance, thread2 overwrites information requested by thread1.
The easiest way to solve this is to use one instance of TOracleSession, wich is created in the initialization of you dll with the property ThreadSave set to TRUE.
Each request-thread creates his own instance of TOracleQuery and free it when handling of the request has finished. This OracleQuery is linked to the global session (setting the Session-property of the OracleQuery).

Oliver

------------------
Oliver Kaesmann
 
Oliver,
Thanks for the reply. My first attempt at solving this was to dynamically create a new session and assign all my oracledatasets to this session (using a randomly generated name for each session). Unfortunately, this is worse then before. Now, two simultaneous users will crash the dll regardless of what their doing. I have 35 toraclewwdatasets in my web module and would rather not have to construct those dynamically if possible, however, if that's my only solution, then I'll go that route.

I was under the impression from what I've read that each iteration of the dll spawns off a new copy of the web module each time. From debugging, that definitely doesn't appear to be the case as the web module oncreate is only called the first time the dll is executed. I'd appreciate any enlightenment on the subject.
 
Okay, my mistake. The multiple sessions works. I had the session variable declared globally. It should be defined as either a private or public variable within the web module unit not under the var section of the web module.
 
Back
Top