Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

500pts: Confirmation for connection pooling in c#?

Posted on 2006-11-03
3
Medium Priority
?
177 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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