Establishing connection pool

Establishing connection pool

Postby mohan.p » Tue 26 Feb 2013 11:16

Hi,

I am using LinqConnect.

I am using the following Devart version... Devart.Data.Oracle 6.30.165.0 (Standard Edition)

The Requirement is establishing connection pool, so that I composed connection string as below......
"User Id=TEST;Password=PWD;Server=TestServer; pooling = true; min pool size=5; max pool size=100; connection timeout=200; validate connection= true";

Please take a look at the following code snippent for clarity.......

class Test
{

public IList<TestEntities.Employees> GetAllEmployees()
{
try
{
using (TestEntityDataContext db = new TestEntityDataContext(GetOracleConnection()))
{
var empList = CompiledQuery.Compile((TestEntityDataContext entity) => entity.Employees).Invoke(db);
return empList.ToList();
}
}
catch (Exception)
{
throw;
}
}


public OracleConnection GetOracleConnection()
{
OracleConnection conn = null;

try
{
OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();

oracleBuilder.ConnectionString = "User Id=TEST;Password=PWD;Server=TestServer; pooling = true; min pool size=5; max pool size=100; connection timeout=200; validate connection= true";

conn = new OracleConnection(oracleBuilder.ToString());
}
catch (Exception)
{
throw;
}

return conn;
}
}


and I call those methods from the test page ,

protected void Button1_Click(object sender, EventArgs e)
{
var stopWatch = new Stopwatch();
Test test = new Test();

stopWatch.Start();
var result = test.GetAllEmployees();
Response.Write(result[0].Name + " ");
stopWatch.Stop();

Response.Write(stopWatch.Elapsed.Milliseconds);
stopWatch.Reset();
}


Questions:

1. Whenever I click the button in the test page... It takes same amount of time as it took in the first call.
It does not seem that connection comes from connecion pool.

2. How do I know that connection comes from connection pool? Is there any tool available like SqlProfiler/ Performance Monitor to monitor connection pooling.....?

3. Is this correct way to establish connection pool or Am I missing anything......?

Awaiting your answer.....
mohan.p
 
Posts: 6
Joined: Tue 26 Feb 2013 09:35

Re: Establishing connection pool

Postby StanislavK » Wed 27 Feb 2013 15:57

We've answered you by mail, please confirm that you've received our letter.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Re: Establishing connection pool

Postby mohan.p » Fri 01 Mar 2013 08:55

Yeah.... I received your mail....... Issue has been resolved......
Thanks for your prompt response.....
mohan.p
 
Posts: 6
Joined: Tue 26 Feb 2013 09:35


Return to dotConnect for Oracle