Advertisement

05.12.2004 at 01:27PM PDT, ID: 20987290
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

sqlClient connection pooling, thread safety.

Asked by bswiftly in .NET

I have a multithreaded VB.NET app, and this is my approach.  I have used one connection object that multple threads can use.

then there is an openconnection and closeconnection method that is called throughout different threads... the cn (connection) object is public (not shared) to the class.  Should I make it shared or what?

        Private Sub openConnection()
            Try
                cnTest += 1
                If Not cn.State = ConnectionState.Open Then
                    cn.Open()
                End If
            Catch ioe As InvalidOperationException
                elog.writeEventLog("Connection error #" & cnTest & " in SlaveProcess.OpenConnection()" & vbCrLf & ioe.ToString, EventLogEntryType.Error)
                Thread.Sleep(100)
                openConnection()
            Catch eo As SqlException
                elog.writeEventLog("Connection error #" & cnTest & " in SlaveProcess.OpenConnection()" & vbCrLf & eo.ToString, EventLogEntryType.Error)
            Catch ex As Exception
                elog.writeEventLog("Connection error #" & cnTest & " in SlaveProcess.OpenConnection()" & vbCrLf & ex.ToString, EventLogEntryType.Error)
                Thread.Sleep(100)
                openConnection()
            End Try
        End Sub


Now I know this is probably not the best way, I've never set up a true thread-safe connection pool before.  I also know that the sqlclient is SUPPOSED to handle the connection pooling for you, but I am still getting some errors.  

Start Free Trial
 
Loading Advertisement...
 
[+][-]05.12.2004 at 01:33PM PDT, ID: 11053675

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 01:36PM PDT, ID: 11053700

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Sign Up Now!
Solution Provided By: majodio
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.12.2004 at 01:44PM PDT, ID: 11053768

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 02:19PM PDT, ID: 11054101

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 02:39PM PDT, ID: 11054267

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 02:43PM PDT, ID: 11054290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2004 at 02:56PM PDT, ID: 11054387

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2004 at 07:18AM PDT, ID: 11059378

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2004 at 07:28AM PDT, ID: 11059484

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2004 at 07:37AM PDT, ID: 11059567

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2004 at 08:09AM PDT, ID: 11059946

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2004 at 08:41AM PDT, ID: 11060290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2004 at 05:45AM PDT, ID: 11067718

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2004 at 01:14AM PDT, ID: 11087561

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2004 at 07:09AM PDT, ID: 11089206

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43