My current project is a kind of recorder, i'm using Visual C++ 6.0 and ADO. To simplify the problem: there are two threads. First thread (acquisition) has a higher priority because is dealing with inserting an updating the rows in db (there are a few commands per minute). The second (interface) thread run some update, delete commands and very long time queries (select).
Is there any reason that each thread must have its own instance of
connection (object) to the database, or I can use the the same global
instance connection for both?
one of my mate has his idea that all SQL commands must be queued, and to exist another thread (related to a connection instance) that execute the SQL commands. I agree with this only for select commands that are executed on one thread and may be canceled from another.
Is there any reason that insert, update, delete take long time so they must be enqueued avoiding the blocking of thread (acquisition)?