This content has been marked as final. Show 3 replies
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:
P.S. upgrading to OO4O v10.2.0.2.20 had no difference.
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 !!
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
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 !