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

This is a bit noob question but.. Its happens sometimes to everybody. I never
Suppose I have two instances of the same class. The class has a pointer
When a user goes to my site, my script checks for 2 cookies which
I know this rather goes against the idea of enums, but is it possible
If something goes wrong in a WCF REST call, such as the requested resource
The case goes as following: You have a Boolean property called FullScreenEnabled. You enter
1) user A goes to the site, creates an account, and logs in 2)
The code goes something like this: protected bool IsOKToSend() { bool IsOK = true;
When a pointer goes out of scope, its memory is freed, so why are
My VS 2005 goes unresponsive all the time. I have tried all of the

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.