Title: Message
I think your right David.  I think she should Just Encapsulate a session within Object X and each thread should use that for its processing.  That is what we have used successfully.
 
 
Rob Martin
Software Engineer
 
phone 03 377 0495
fax 03 377 0496   
web www.chreos.com
----- Original Message -----
Sent: Monday, December 08, 2003 5:23 PM
Subject: RE: [DUG] BDE and threads

I'm sure Stacey will confirm this tomorrow but I believe he is already using another mechanism to ensure only one thread will be accessing each session at a time (as his example shows, each thread dies before the next one is created and tries to use the session).
 
So the problem isn't one of getting multiple threads to use the same session at the same time (they know that doesn't work).
 
The problem is one of getting multiple threads to use the same session one after another. Is this possible or is there some fundamental issue with the way the BDE is coded which prevents this?
 
(Correct me if I am wrong Stacey ;-)
 
David.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Kyley Harris
Sent: Monday, 8 December 2003 5:12 PM
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] BDE and threads

each thread should have its own session object, otherwise if 2 threads use a dataset at the same time off one session you'll get corruption
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stacey Verner
Sent: Monday, 8 December 2003 4:58 p.m.
To: [EMAIL PROTECTED]
Subject: [DUG] BDE and threads

Is it possible to have a bde database connection that can be accessed by multiple threads?
 
e.g.
 
Thread 1:
- Create Object X
  - Connect to database.
Thread 1 dies
 
Thread 2
- Find Object X
  - Run SQL on database
Thread 2 dies
 
Thread 3
- Find Object X
  - Run SQL on database
Thread 4 dies
 
Thread 4
- Find Object X
  - Disconnect from database
  - Destroy X
Thread 4 dies
 
This is a service application which is listening for connections, and performing tasks on databases.
 
I want to keep the database connection between requests because the actions performed by the 2nd and 3rd requests can be within a transaction.
 
Thanks
 
Stacey
 
Stacey Verner             Ph:   +64-9-4154790
Software Developer        Fax:  +64-9-4154791
                          DDI:  +64-9-4154797
CJN Technologies Ltd.     Email:
[EMAIL PROTECTED]
PO Box 302-278, North Harbour, Auckland 1330, New Zealand
12 Piermark Drive, North Harbour, Auckland, New Zealand
Visit our website at
http://www.cjntech.co.nz/
 


_______________________________________________
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