Hi Donovan
I have found it necessary to encapsulate all dataset access on a common
table within a critical section :(
Most important is to relocate the cursor to the expected row after entering
the critical section as the other threads may well have moved it in the
meantime.
If the tables are independent then definitely use one session per thread -
it saves a lot of heartache.
Stephen
-----Original Message-----
From: Bevan Edwards [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 7 August 2001 3:58 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: [Q] Multi threaded BDE Access....
>From my understanding, you should ideally have one TSession per thread.
Bevan
"Donovan J. Edye" wrote:
>
> G'Day All,
>
> I have the following scenario and want to know what the pitfalls,
> gotcha's etc. are
>
> - Componen1 appends records to TableA and is running in the context of
> the main application thread
> - Component1 uses a TDatabase connection for the main application
> - Component2 creates its own thread that does locates and reads off
> the table
> - Component2 uses a TDatabase connection for the main application
>
> Essentially, what should be done for multithreaded BDE DB access.....
>
> TIA
>
> -- Donovan
> ----------------------------------------------------------------------
>
> Donovan J. Edye [www.edye.wattle.id.au]
> Namadgi Systems [www.namsys.com.au]
> Voice: +61 2 6285-3460
> Fax: +61 2 6285-3459
> TVisualBasic = Class(None);
> Heard just before the 'Big Bang': "...Uh Oh...."
> ----------------------------------------------------------------------
>
> GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
> replacement. Also includes freeware delphi windows explorer
> components.
> ----------------------------------------------------------------------
--
Bevan Edwards mailto:[EMAIL PROTECTED]
Achieve Software Limited http://www.achieve.co.nz
Phone: (64-9) 444-4210 ICQ: 732011
Fax: (64-9) 444-4201
Mobile: (64-21) 979-603
---------------------------------------------------------------------------
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/
---------------------------------------------------------------------------
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/