This discussion is archived
3 Replies Latest reply: Oct 23, 2007 1:51 PM by 370080 RSS

conn not closing

555965 Newbie
Currently Being Moderated
Hello there.
I'm trying to migrate a classic ASP app from a Win2k Server to a Win2003 Server. Everything was fine until the database claimed too many connections and every other application stopped working. The app is using OO4O (10.2.0.1.0) as a driver to an Oracle 10g (10.2.0.1.0) database.
Every time the app establishes a new connection thru an OraSession COM, we can get a connection to the DB server that keeps on a ESTABLISHED status forever. The number of connections grows as the users do their work to the point that the systems administrators have to restart the app.
We pick the conn status by simply using the good old netstat -na | find "DB server ip address".
Can anyone have a clue on this?
Thank you!
  • 1. Re: conn not closing
    555965 Newbie
    Currently Being Moderated
    I've found the problem or at least a way to avoid keeping the connection open.
    By some unknown reason the connection was kept alive thanks to stored procedures. Adding parameters to the oraDatabase object was the cause. After the procedure return it showed necessary to remove each of the parameters added. It's also noteworthy to say that the remove method doesn't look to work right. If you iterate from 0 to count-1 (or even count) along the parameters collection asking to remove the items you end up with a parameter still allocated.

    In the end a question remains: why is this removal procedure necessary in Windows 2003 and not in Windows 2000 Server?

    Message was edited by:
    Takahashi

    P.S. upgrading to OO4O v10.2.0.2.20 had no difference.
  • 2. Re: conn not closing
    558995 Newbie
    Currently Being Moderated
    We are having the same problem. With oo4o 9 the connection doesn't close when not removing all the paramaters...

    Irritating cause in previous version the connection did close...

    Suggestions and solutions welcome ;)
  • 3. Re: conn not closing
    370080 Newbie
    Currently Being Moderated
    Had the same problem. Read your post and then figured it out (here it is in VB)

    Dim c As Long
    Dim i As Long
    c = mConnection.Parameters.Count 'mConnection is the OraDatabase
    For i = 1 To c
    mConnection.Parameters.Remove c - i 'Remove starting from the (zero-based) end !!
    Next
    mConnection.Close
    Set mConnection = Nothing

    I tried removing elements from the beginning with a FOR EACH loop in my first attempts but to no avail. After stepping through the collection of parameters after each removal, I gathered that when an element is removed, all subsequent elements are moved towards the beginning of the collection BUT the loop pointer to the next element moves FORWARD to the next element (an expected and desirable behavior when no element are removed) which in effect means the pointer skips an element, removing every other element !

    Then I tried this:

    Do Until mConnection.Parameters.Count = 0
    mConnection.Parameters.Remove 0
    Loop

    Works just as good, just not as efficiently since the elements have to be moved around a lot after removing the first one over and over again :)

    Hope this helps you as much as you guys helped me !


    Thanks guys !

    Mikey