?
Solved

500pts: Confirmation for connection pooling in c#?

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

755 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