Solved

500pts: Confirmation for connection pooling in c#?

Posted on 2006-11-03
3
165 Views
Last Modified: 2010-04-16
Hi there,

I wonder if anyone can help. I have an application that i wish to keep at least 10 connections open to the database and as i need to increase or decreases the pool when i need to..

Now i believe I can do this in c# with the oracle Data Provider for .NET...

My question is .... basically i am going to be using it for a web service... I presume when I have those 10 connections -- they are automatically OPEN and in my Code i still use a new connection object which i do like this (which closes the object)

_conn is a string that can be accessed from Global - the connection string.

using (OracleCommand cmd = new OracleCommand("supp.PACK_TEMP.GET_INFO",Global._conn))
{
//
}

My worry is that when i am opening and closing connections all the time, this isn't opening and closing a connection to the database but is setting the connection in the pool to "in use" and "not in use"....

This is where i am a little worried... I want to ensure that once the connection is OPEN it stays open.... for others methods to access...


So when i am doing Open and Close in my code... i am not actually opening connections to the db but using existing OPEN connections..

I hope someone can help

Thanks in advance

Ian

0
Comment
Question by:ianinspain
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
mastoo earned 500 total points
Comment Utility
Yes.  With pooling, the Close doesn't actually close a connection but instead "returns" it to the pool for the next time you need one.  From a database perspective, the server doesn't even see the close.
0
 
LVL 21

Expert Comment

by:mastoo
Comment Utility
I notice with Oracle you can run perfmon and watch the .NET Data Provider for Oracle, HardConnectsPerSecond to verify that your pooling works as expected.  The corresponding softconnects is how many connections your code thinks it is making.
0
 

Author Comment

by:ianinspain
Comment Utility
thats .. great...

thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now