Solved

500pts: Confirmation for connection pooling in c#?

Posted on 2006-11-03
3
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
mastoo earned 500 total points
ID: 17870452
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
ID: 17870474
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
ID: 17880286
thats .. great...

thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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