Normally we've been able to get on with things quite happily without knowing the
answer to this question, but it would be quite nice to know. I have looked elsewhere
for this, but never found it. I figured maybe someone on this list would know.
In websnap, if you ask for web module John, the factory gives you a free instance, or
makes one for you: John_1.
eg John.Method() gives you John_1.Method()
Our experience has been that if you have another John.Method() later you get the same
instance.
eg another John.Method() gives you John_1.Method()
This suggests that the first call to John (any reference to John is a function call
which asks the factory for a free instance) finds a free instance, then gives it to
your thread, my guess is until the thread finishes execution. Subsequent calls realise
that we've allready asked for a John, and give back the same one. Other threads can't
use our John until the thread finishes. At the end of this thread's execution our John
is returned to the stockpile (automatically via some hidden mechanism).
Or am I wrong? Is it just dumb chance that we seem to get back the same one every time?
If I am right, what events can I put some initialisation and finalisation code into?
The Request object seems to be global for this thread. How can I make my own global
for this thread objects? If my guess about how the factories work is right, then I
suppose just adding them to some web module would do this, but is there another way?
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/