Solved

500pts: Confirmation for connection pooling in c#?

Posted on 2006-11-03
3
172 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 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