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 7831735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:51:56+00:00 2026-06-02T11:51:56+00:00

I am using ADO.Net for connecting to some Sql Server and Oracle databases, and

  • 0

I am using ADO.Net for connecting to some Sql Server and Oracle databases, and I want to run some of my queries concurrently.

I use classes from SqlClient namespace for Sql Server and ODP.Net for Oracle. For Sql Server I added MARS option to the connection string, and call asynchronous APIs on SqlCommand. ODP.Net does not provide asynchronous API, so I have to give my concurrent Oracle commands separate threads.

My question is, how should I handle connection objects? Should I create one DbConnection per each database instance and execute commands asynchronously against a single connection, or should I give a separate connection object to each of my concurrent commands? Does a shared connection object become a contention point for multiple commands executing through it simultaneously?

I will write some comparison tests but would love to hear from somebody who has experience with asynchronous database commands. Thank you in advance!

  • 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-06-02T11:52:02+00:00Added an answer on June 2, 2026 at 11:52 am

    Some time ago we faced this issue and chose to handle a separate connection object to each of the concurrent commands. It was an application making a lot of use of the database (for each page there were around 40 queries executed). We saw this was very slow because of the connection creation.

    So, we changed it to a single connection (a singleton) used by every command executed. This fixed the issue and we were happy to see the application was responding faster. However, the application began growing and the need of transactions was urgent, but we faced the problem that this was not possible in our model. We ended using a mix: whenever the connection needed transactions we created a new one, if no transactions were needed then we reused the one that had been created in the singleton.

    What i would do now is to use a single connection and use a transaction pattern inside the stored procedures called; avoiding having to handle the transaction on the application server.

    Hope it was helpful.

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

Sidebar

Related Questions

When connecting to oracle server from .NET application using ADO.NET for oracle, even if
I'm developing an ASP.NET app (C#) that connect to SQL Server 2008 using ADO.NET
I have an ADO.NET connection object to an SQL Server (which will use connection
I am doing some performance tests using .Net 3.5 against SQL Server. I am
I'm using ADO .NET and MS SQL Server 2008. I have a connection object
I am using SQL Server 2008 Enterprise + C# + ADO.Net + .Net 3.5.
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop,
I have a problem connecting to Informix server(windows) using ADO.NET. I'm using Listing 1
While I establish a connection to SQL Server using ADO.NET, it showing errors. Following
When I try to establish a connection to SQL Server using ADO.NET, it shows

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.