Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 864677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:31:04+00:00 2026-05-15T09:31:04+00:00

How goes it everybody? Very simple question today. If I give two separate Threads

  • 0

How goes it everybody?

Very simple question today. If I give two separate Threads two different SqlCommands. If both SqlCommands use the same SqlConnection, can they execute at the same time? Does SqlConnection block this behavior? Or does something… more interesting happen?

(I do believe SqlConnections are pooled by connection string for this exact reason, but I just need some reassurance)


This is a hypothetical question, just curious how SqlConnection behaves given the design described.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:31:04+00:00Added an answer on May 15, 2026 at 9:31 am

    With ADO.NET connection pooling in place, the proper way to run a query is to create and open a connection object, then run a command object (which uses the connection object), and then close the connection. So the scenario you describe (where you hand an open connection to two different command objects) should never occur. In normal usage your two different command objects should open and close their own connection objects independent of each other, which means you will never run into the problem of two command objects simultaneously attempting to use the same connection at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SISS 2008 - My package goes green very quickly, but does nothing. The connections
This goes back to my other question which I thought was sufficiently answers but
I've developed a Webbapp that makes an extensive use of threads. We need to
everybody! I'm trying to digitally sign some data in C#. Everything goes without error
Here goes a yet another SQL question about dates… I'm building a calendaring application
Here goes a SQL-Java coding style question... How do others here deal with creating
Here goes my first question. First of all I'm new with Java and still
here goes my two MySQL Queries and can some guide me which is the
Here goes newbie question number 5, but I don't have a teacher.. so.. anyhow
This is a bit noob question but.. Its happens sometimes to everybody. I never

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.