Title: Message
We receive a TCP/IP request.  Create a new Client object which creates is processing thread that has its own unique session.  So now that I think about it the answer is no, we really only have 1 thread / session but multiple clients.
 
I have just done a quick web search and it appears each Thread must have its own unique session.
 
'The programmer should note that each thread must maintain a separate database connection for this to work properly. Hence, each thread should use a separate TSession object to manage its connection to the database.'
 
 
 
Rob Martin
Software Engineer
 
phone 03 377 0495
fax 03 377 0496   
web www.chreos.com
----- Original Message -----
Sent: Tuesday, December 09, 2003 9:30 AM
Subject: RE: [DUG] BDE and threads

>> Apologies to Stacey if I got your sex wrong :)  For some reason I thought you were a woman.... oopps :)
no worries. happens all the time.
 
I have implemented my objects as you say so that each object has its own TDatabase and TSession but I get the error "implicit connection not allowed after explicit connection" (this is an Informix error).
This is an informix error.
 
We do multi threaded database connections in other software which work fine but each TDatabase and a TSession is only accessed by one thread which is the thread the created them.
 
In this case we have multiple threads accessing Object X (never more than one at at a time) which contains the TDatabase and TSession.
 
Do you have this situatuation?
 
The processin more detail.
  • We have a TidTCPServer. This recieves a connection from the client and creates a new thread to process that request. Within the thread:
    • We look at the request:
      • If it is a connect request we create a new ServerSession with its own TDatabase and TSession component and connect to the database (ALL SEEMS OK).
      • If not we get the ServerSessionID from the request and get the ServerSession object from a TTreadList and perform the request (say "BEGIN WORK")
So each time a request is processed we have a brand new thread.
 
It may be that I have to have a persistent thread for each Object X.
 
Thanks
 
Stacey


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to