Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Is ADO thread safe ?

Is ADO thread safe ?

Scheduled Pinned Locked Moved Database
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hesham Amin
    wrote on last edited by
    #1

    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 ?

    M 1 Reply Last reply
    0
    • H Hesham Amin

      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 ?

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • M Mike Dimmick

        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

        H Offline
        H Offline
        Hesham Amin
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups