Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODP.NET connection not closing

410353Oct 16 2006 — edited Nov 7 2008
Good Day Folks,

We want to use connection Pooling to improve performance, but with Pooling set to true, Oracle connections do not close and eventually pile up. With Pooling set to false, the connections close properly, but performance is slow.

Below is typical code I use in my project to read data.

Any ideas on how to solve this problem ? The version of ODP.NET we're using is shown below.

---------------------------------------------------------------------------
Oracle Data Provider for .NET 10.2.0.2.20 Production
---------------------------------------------------------------------------

Thanks in advance
/Serge


------------
' typical code used to read data.

dim connstring as string="Data Source=WEB;User ID=myuserid;Password=mypassword;Pooling=True;Connection Lifetime=15;Max Pool Size=1;HA Events=true;Incr Pool Size=1;"

dim sqlConn as OracleConnection
sqlConn =New OracleConnection(connstring)
sqlConn.open()

dim theSQL as string="select * from mytable"

Dim myCommand As New OracleCommand(theSQL,sqlConn)

dim myRecordSet as OracleDataReader
myRecordSet=myCommand.ExecuteReader()

myCommand.dispose()


' Display the data.
' simple do while... loop.


' Close the recordset

myRecordSet.close()
myRecordSet.dispose()

' Close the connection.

sqlConn.close()
sqlConn.dispose()
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2023
Added on Oct 16 2006
10 comments
10,264 views