Is ADO thread safe ?
-
Hi I use ADO (MDAC 2.8) in a multithreaded application I call the Connection's Execute method from more than 1 thread. Is this safe ? or must I use a critical section to protect this operation ?
-
Hi I use ADO (MDAC 2.8) in a multithreaded application I call the Connection's Execute method from more than 1 thread. Is this safe ? or must I use a critical section to protect this operation ?
ADO's objects are marked ThreadingModel=Apartment in the registry. COM will marshal any calls back to the thread which created the object. This means that concurrent calls will get queued up until the creating thread is ready to handle them. If this is a problem, create a separate Connection object on each thread. Stability. What an interesting concept. -- Chris Maunder
-
ADO's objects are marked ThreadingModel=Apartment in the registry. COM will marshal any calls back to the thread which created the object. This means that concurrent calls will get queued up until the creating thread is ready to handle them. If this is a problem, create a separate Connection object on each thread. Stability. What an interesting concept. -- Chris Maunder
thank you for the reply this behavior will not cause problems..It looks safe and that's what I need.. :) being queued will not cause a big performance problem at all.