Forcing odp.net connection

Discussion in 'ASP .Net' started by Big George, Aug 30, 2012.

  1. Big George

    Big George Guest

    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?
    Big George, Aug 30, 2012
    #1
    1. Advertising

  2. Big George

    Arne Vajhøj Guest

    On 8/29/2012 11:24 PM, Big George wrote:
    > 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
    Arne Vajhøj, Aug 30, 2012
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9vc3QgRXZlcnRzZQ==?=

    ODP.NET : VB.NET and PLSQLAssociativeArray, hanging webserver

    =?Utf-8?B?Sm9vc3QgRXZlcnRzZQ==?=, Nov 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,274
    John Saunders
    Nov 6, 2004
  2. SK

    odp.net

    SK, Feb 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    673
    Scott Allen
    Feb 14, 2005
  3. venky

    Odp.net

    venky, Feb 15, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    884
    venky
    Feb 15, 2005
  4. Nathan
    Replies:
    0
    Views:
    1,601
    Nathan
    Jan 5, 2006
  5. Replies:
    2
    Views:
    14,257
    dguisinger
    Jul 6, 2006
Loading...

Share This Page