[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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!

9.1

Data access layer design with ADO.Net pooled connections

Asked by CyrexCore2k in .NET, C# Programming Language, Microsoft Visual Basic.Net

I was just curious if anyone has dealt with the issue of pooled connections when trying to create a database access layer.

I'm working on a project that was given to me and I've been running into issues with the connection pool of 300 being maxed out. After finding some of my own mistakes I've found that the data layer created by the original designers has a connection leak that they apparently chose to ignore. Some of the objects have a findall method that goes something like this

Public Function FindAll() As SqlDataReader
        Dim found As Boolean = False
        Dim conn As SqlConnection = New SqlConnection(_DSN)
        Dim myCommand As SqlCommand
        Dim myReader As SqlDataReader
        conn.Open()
        myCommand = New SqlCommand("sproc_tbNetworkGetAll", conn)
        myCommand.CommandType = CommandType.StoredProcedure
        myReader = myCommand.ExecuteReader()
        Return myReader
End Function

Obviously they couldn't close the connection because then the reader wouldn't work so they just left it like this. Since they let the connection object go out of scope it'll sit in the pool until GC picks it up which I've heard can take hours.

Has anyone else dealt with this in an elegant fashion? I'll give points to anyone who provides some useful information.
[+][-]04/26/08 11:02 PM, ID: 21448305Accepted Solution

Your question has an Asker Certified™ answer! CyrexCore2k verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zones: .NET, C# Programming Language, Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: naspinski
Participating Experts: 2
Solution Grade: A
 
[+][-]04/26/08 11:16 PM, ID: 21448322Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/08 11:18 PM, ID: 21448325Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/08 11:19 PM, ID: 21448328Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/08 12:21 PM, ID: 21450089Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/08 10:04 PM, ID: 21451661Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/08 06:06 AM, ID: 21453536Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20100308-EE-VQP-141 / EE_QW_EXPERT_20070906
Your technology problems solved.
Close See Plans and Pricing. Try it FREE for 30 days.