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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:41:34+00:00 2026-05-24T01:41:34+00:00

I am hosting a WCF service which uses the mysql connector. For some reason

  • 0

I am hosting a WCF service which uses the mysql connector. For some reason once every 5-10 minutes I get an error that mysql is already in use. What should I do? Set it up so that it blocks, have it create a new connection per thread or setup a manager which creates a set number of connections and will block until a connection becomes available. Actually do the asynchronous calls already do that last part? Lastly whats the best way to block until another thread completes and get information from that thread?

public static int Query(this IDbConnection olddb, string query, params object[] args)
{
    using (var db = olddb.CloneEx())
    {
        db.Open();
        using (var com = db.CreateCommand())
        {
            com.CommandText = query;
            for (int i = 0; i < args.Length; i++)
                com.AddParameter("@" + i, args[i]);

            return com.ExecuteNonQuery();
        }
    }
}
Unhandled Exception: System.NotImplementedException: The requested feature is not implemented.
  at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction transaction) [0x00000] in :0
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in :0
  • 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-24T01:41:35+00:00Added an answer on May 24, 2026 at 1:41 am

    Everytime you need to query your SQL server simply:

    using (var conn = new MySqlConnection("Some connection string"))
    using (var cmd = conn.CreateCommand())
    {
        conn.Open();
        cmd.CommandText = "SELECT foo FROM bar";
        using (var reader = cmd.ExecuteReader())
        {
            while (reader.Read())
            {
                // process the results
            } 
        }
    }
    

    This ensures that connections are returned into the connection pool that ADO.NET manages for you and so that you don’t get any risks of creating multiple connections that could slow things up. Also this code is perfectly reentrant and thus by definition thread safe => it could be executed concurrently from as many threads as you wish.

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

Sidebar

Related Questions

I've got a WCF service that I'm hosting in IIS 7, which I connect
I have six wcf services that I'm hosting in a windows service. Everything works
I have written a WCF service that I am hosting in IIS7 as a
I am having some trouble hosting a WCF service inside a Windows Service. I
I have a client (a Unit Test) that call to WCF Service (hosting in
When hosting a WCF service on IIS you have an option of manually configuring
I am hosting a WCF service in a Windows Service on one of our
I have a Console application hosting a WCF service. I would like to be
From what I've seen the tag is ignored when hosting a WCF service in
This is in relation to this question I am hosting this WCF service in

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.