multi-threading and MyDAC
Posted: Tue 06 Mar 2007 16:59
I have a Windows Service application that is heavily multi-threaded.
There are many threads which each insert new rows into the same table. Each thread uses a unique TMyConnection and TMyQuery component. The connection is kept open. Every few minutes each thread inserts a bunch of new rows into the table using an SQL INSERT command. The primary key for the table is an auto-increment BIGINT.
The problem is that every few thousand records I get a database error (in the production environment) when executing the INSERT command.
If I reduce the environment to a single thread, it works fine. Also, when this was using the Borland BDE it worked fine.
Help!
There are many threads which each insert new rows into the same table. Each thread uses a unique TMyConnection and TMyQuery component. The connection is kept open. Every few minutes each thread inserts a bunch of new rows into the table using an SQL INSERT command. The primary key for the table is an auto-increment BIGINT.
The problem is that every few thousand records I get a database error (in the production environment) when executing the INSERT command.
If I reduce the environment to a single thread, it works fine. Also, when this was using the Borland BDE it worked fine.
Help!