Forcing odp.net connection

B

Big George

Asp.net 2.0 using odp.net 10.1.04 to connect to Oracle 10g

Our web application has this problem: ODP-1000 "Connection request
timed out".
As we know, this is a memory leak problem, caused due open connections
that don't get closed and disposed.

We have double checked our code and all connections after open are
closed and disposed. All odp.net objects like OracleCommand,
Oracledatareader are disposed after used.

As we can't find in our code any unclosed connection, is there any way
to force connection when conn.Open gets error "Connection request
timed out"?

When we get error "Connection request timed out", asp.net program can
connect after closing it and load it again, then . So, I think if I
can force it with this function:


Public Sub OpenConnection(ByRef conn As OracleConnection)
Do While conn.State <> ConnectionState.Open
Try
'Connection with Pooling=True
conn = New
Oracle.DataAccess.Client.OracleConnection("user id=xxx;data
source=xxx;password=xxx;Pooling=True;Connection Timeout=15;Incr Pool
Size=5;Decr Pool Size=3;Max Pool Size=300;Min Pool Size=10;Validate
Connection=true;")
If (conn.State <> ConnectionState.Closed) Then
conn.Close()
conn.Open()

Catch ex As Exception

If (conn.State <> ConnectionState.Closed) Then
conn.Close()
'Alternative Connection with Pooling=False
conn = New
Oracle.DataAccess.Client.OracleConnection(user id=xxx;data
source=xxx;password=xxx;Pooling=False;Connection Timeout=15;)
conn.Open()
End If
End Try
Loop
End Sub


Could it loop to infinite if never catch an available connection? It
would be necessary to create a new asp.net session in order to get
connection to database?
 
A

Arne Vajhøj

Asp.net 2.0 using odp.net 10.1.04 to connect to Oracle 10g

Our web application has this problem: ODP-1000 "Connection request
timed out".
As we know, this is a memory leak problem, caused due open connections
that don't get closed and disposed.

I don't know if that is the only possible cause, but it is
a possible cause.
We have double checked our code and all connections after open are
closed and disposed. All odp.net objects like OracleCommand,
Oracledatareader are disposed after used.

Do you always use using or finally to ensure that you do not
leak connections in case of exceptions etc.?

Can other application connecting to the same database be leaking
connections?
As we can't find in our code any unclosed connection, is there any way
to force connection when conn.Open gets error "Connection request
timed out"?

Not that I know about.
When we get error "Connection request timed out", asp.net program can
connect after closing it and load it again, then .

What does "closing an ASP.NET program mean"??
Public Sub OpenConnection(ByRef conn As OracleConnection)
Do While conn.State <> ConnectionState.Open
Try
'Connection with Pooling=True
conn = New
Oracle.DataAccess.Client.OracleConnection("user id=xxx;data
source=xxx;password=xxx;Pooling=True;Connection Timeout=15;Incr Pool
Size=5;Decr Pool Size=3;Max Pool Size=300;Min Pool Size=10;Validate
Connection=true;")
If (conn.State <> ConnectionState.Closed) Then
conn.Close()
conn.Open()

Catch ex As Exception

If (conn.State <> ConnectionState.Closed) Then
conn.Close()
'Alternative Connection with Pooling=False
conn = New
Oracle.DataAccess.Client.OracleConnection(user id=xxx;data
source=xxx;password=xxx;Pooling=False;Connection Timeout=15;)
conn.Open()
End If
End Try
Loop
End Sub


Could it loop to infinite if never catch an available connection?

It would depend on where the problem really are.

But I think it could happen.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,828
Messages
2,569,736
Members
45,518
Latest member
vlonesshirt

Latest Threads

Top