473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

this.Connection.Close(); does not close the Oracle session! Pleasehelp!

S_K
Hi all!

I'm writing an ASP.NET web application that uses an Oracle database.

I OPEN the Oracle connection by using the following code:

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}

I then create the command object by using the following:

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.

I then CLOSE the connection by using the
this.Connection.Close(); command.

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!

Thanks
Steve
Dec 6 '07 #1
6 16730
I'm pretty sure "OracleConnection" is not a standard Framework class. You'll
probably have better luck asking the component vendor (or in their forums).
My guess is that it has to do with connection pooling. Do the number of
connections grow endlessly, or are they reused over and over? If it's the
later, then you should actually have a very happy DBA.

Scott

"S_K" <st***********@yahoo.comwrote in message
news:36**********************************@e10g2000 prf.googlegroups.com...
Hi all!

I'm writing an ASP.NET web application that uses an Oracle database.

I OPEN the Oracle connection by using the following code:

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}

I then create the command object by using the following:

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.

I then CLOSE the connection by using the
this.Connection.Close(); command.

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!

Thanks
Steve
Dec 6 '07 #2

Did you close the reader?

if(null!=reader)
{
reader.Close();
}

???

A reader is a live firehouse....thus you use it, then you tidy up.
You can't get reader, close the connection , then use the reader. That
doesn't make sense.

Use the reader as quickly as possible, then close it.


"S_K" <st***********@yahoo.comwrote in message
news:36**********************************@e10g2000 prf.googlegroups.com...
Hi all!

I'm writing an ASP.NET web application that uses an Oracle database.

I OPEN the Oracle connection by using the following code:

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}

I then create the command object by using the following:

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.

I then CLOSE the connection by using the
this.Connection.Close(); command.

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!

Thanks
Steve

Dec 6 '07 #3
you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.

-- bruce (sqlwork.com)
"S_K" wrote:
Hi all!

I'm writing an ASP.NET web application that uses an Oracle database.

I OPEN the Oracle connection by using the following code:

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}

I then create the command object by using the following:

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.

I then CLOSE the connection by using the
this.Connection.Close(); command.

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!

Thanks
Steve
Dec 6 '07 #4
S_K
On Dec 6, 3:13 pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:
you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.

-- bruce (sqlwork.com)

"S_K" wrote:
Hi all!
I'm writing an ASP.NET web application that uses an Oracle database.
I OPEN the Oracle connection by using the following code:
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
I then create the command object by using the following:
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
I then CLOSE the connection by using the
this.Connection.Close(); command.
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
Thanks
Steve- Hide quoted text -

- Show quoted text -
I don't actually CLOSE the reader but I DO Dispose the reader:
reader.Dispose();

Doesn't that close the reader as well???

Also, how do you turn off the connection pooling in the connection
string? All I have is the basic connection string.

Thanks for your quick replies.

Steve
Dec 6 '07 #5
no, dispose will return it to the pool if pooling is enabled (all dispose
does is call close if needed).

you will need the connection string settings docs for the driver you are
using..

-- bruce (sqlwork.com)
"S_K" wrote:
On Dec 6, 3:13 pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:
you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.

-- bruce (sqlwork.com)

"S_K" wrote:
Hi all!
I'm writing an ASP.NET web application that uses an Oracle database.
I OPEN the Oracle connection by using the following code:
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
I then create the command object by using the following:
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
I then CLOSE the connection by using the
this.Connection.Close(); command.
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
Thanks
Steve- Hide quoted text -
- Show quoted text -

I don't actually CLOSE the reader but I DO Dispose the reader:
reader.Dispose();

Doesn't that close the reader as well???

Also, how do you turn off the connection pooling in the connection
string? All I have is the basic connection string.

Thanks for your quick replies.

Steve
Dec 6 '07 #6
OracleConnection is in the System.Data.OracleClient namespace.

Although Oracle also provides such a class, in their
Oracle.DataAccess.Client namespace.

If the connection pool advice doesn't work out, try also calling
Dispose on the connection. Unless the issue has been resolved in a
recent version, there's a flaw in the Framework class that
necessitates this. And it can't hurt in any event.

On Dec 6, 4:52 pm, "Scott Roberts" <srobe...@no.spam.here-webworks-
software.comwrote:
I'm pretty sure "OracleConnection" is not a standard Framework class. You'll
probably have better luck asking the component vendor (or in their forums).
My guess is that it has to do with connection pooling. Do the number of
connections grow endlessly, or are they reused over and over? If it's the
later, then you should actually have a very happy DBA.

Scott

"S_K" <steve_kers...@yahoo.comwrote in message

news:36**********************************@e10g2000 prf.googlegroups.com...
Hi all!
I'm writing an ASP.NET web application that uses an Oracle database.
I OPEN the Oracle connection by using the following code:
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
I then create the command object by using the following:
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYME NT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
I then CLOSE the connection by using the
this.Connection.Close(); command.
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
Thanks
Steve- Hide quoted text -

- Show quoted text -
Dec 7 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: keefy | last post by:
Hi, We have a c++ routine with an embedded python interpreter. The c++ routine calls a python script many times in a single session. The script does a lookup on an oracle database and then...
3
by: Harry | last post by:
Using Oracle 8i enterprise on win 2000 (sp3) Installed the standard configuration & whenever I make a connection it takes about 10 secs. It's running on a P1900 with 1gb Ram so no reason there...
4
by: Steve | last post by:
We are using ODP.net (version 9.2.0.4.01) as data provider for Oracle in our dotnet app. Currently we are using Microsoft.NET Framework 1.1 (VS.net IDE 2003) in our project. One thing I feel...
3
by: Grigs | last post by:
Hello, I have a web service that reads its web.config file to connect to an Oracle database. There are a number of methods in this socalled BACKBONE that either send inforomation to or from the...
15
by: Rob Nicholson | last post by:
I'm starting to worry a bit now. We're getting the above error when two users hit the same database/page on an ASP.NET application using ADO.NET, talking to a SQL 7 server. The error is perfectly...
3
by: Andy G | last post by:
I have some code that hits a DB2 database from my ASP.NET application. I haven't been able to exactly nail it down but my connections are not getting closed for some reason. I look at the...
7
by: Lau Lei Cheong | last post by:
Hello, Actually I think I should have had asked it long before, but somehow I haven't. Here's the scenerio: Say we have a few pages in an ASP.NET project, each of them needs to connect to...
0
by: | last post by:
Hi All, I have a client connection problem with Oracle. The exe which i did with C# (vs.net 2005) and Oracle XE , works well on my developer machine but i am getting a connection string error on...
1
by: pangalanrao | last post by:
Private Sub testing() Dim strConnection As String Dim conn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim strSQL As String 'strConnection = " {FileDSN=sms } ; UID=suz_order_system;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.