When does DOTNET drop the OracleConnection ??

  • Thread starter Thread starter BTHOMASinOHIO
  • Start date Start date
B

BTHOMASinOHIO

I'm new to DOTNET and wanted to know when the Oracle Connection is
dropped?

Example: In my code I call an "ORACLEConnection.Close()" and the
connection is dropped, but what if in the middle of the code, I
redirect to another ASPX Page? Is the Connection Dropped? When the
Browser is closed, is the Connection Dropped?

I'm sure these are stupid questions, but I don't know unless I ask,
right ?!
 
Hi Thomas,
This question is not at all stupid. There are two cases when you drop a
connection.
Case 1.
If you do not use pooling, the Connection is dropped as soon as you call
Connection.Close.
Case 2:
If you use pooling:
a. When calling Connection.Close, the connection does not go away;it
goes back to the pool and the connection is still active to the server. But
the OracleConnection object's state is set to Closed.
b. When you leave the App Domain (like the browser is closed), the
connection pool is cleared and the active connections in the pool are
cleared.

Hope that helps.
Sushil
 
b. It's rather when the app shutdown server side rather when the browser is
closed client side ?

--
 
Hi Friends
That was very interesting discussion
I have a related doubt. How about Sql Server connection. Will it behave just
likve Oracle connection. for that matter who will take responsibility of
closing the connection .NET or Sql Server. When does Sql Server connection
gets close.

and another doubt. when we say datareader.close does the sql server
connection closes. it not what does datareader.close mean

Satish
 
Back
Top