[Mono-bugs] [Bug 60172][Nor] New - OdbcConnection.Open: Exception thrown after a few calls.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 14 Jun 2004 18:23:09 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sebastien.robitaille@croesus.com.
http://bugzilla.ximian.com/show_bug.cgi?id=60172
--- shadow/60172 2004-06-14 18:23:09.000000000 -0400
+++ shadow/60172.tmp.4157 2004-06-14 18:23:09.000000000 -0400
@@ -0,0 +1,84 @@
+Bug#: 60172
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: sebastien.robitaille@croesus.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: OdbcConnection.Open: Exception thrown after a few calls.
+
+Description of Problem:
+
+An exception is thrown when OdbcConnection.Open is called more than 188
+times.
+
+Hint: OdbcConnection is leaking ODBC resource handles.
+
+The following members in OdbcConnection.cs are allocated with
+SQLAllocHandle but are never freed with SQLFreeHandle:
+
+henv, hdbc
+
+Steps to reproduce the problem:
+1. Call OdbcConnection.Open() many times and see that after 188 calls, an
+exception is thrown:
+
+System.Data.Odbc.OdbcException: [unixODBC][FreeTDS][SQL Server]Login
+incorrect.
+in <0x003c8> System.Data.Odbc.OdbcConnection:Open ()
+in <0x0004f> (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcConnection:Open ()
+in <0x0006b> MonoOdbcDataSetTest.Class1:TestConnections ()
+
+
+2. Execute the following code:
+
+OdbcConnection connection = new OdbcConnection(connectionString);
+for(int nIndex = 0; nIndex < 1000; nIndex++)
+{
+ connection.Open();
+ System.Console.WriteLine(nIndex);
+ connection.Close();
+}
+
+
+Actual Results:
+0
+1
+...
+186
+187
+188
+System.Data.Odbc.OdbcException: [unixODBC][FreeTDS][SQL Server]Login
+incorrect.
+in <0x003c8> System.Data.Odbc.OdbcConnection:Open ()
+in <0x0004f> (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcConnection:Open ()
+in <0x0006b> MonoOdbcDataSetTest.Class1:TestConnections ()
+
+
+Expected Results:
+0
+1
+...
+998
+999
+
+How often does this happen?
+Always
+
+Additional Information:
+
+Sybase Database
+mono-0.95
+freetds-0.62.3
+unixODBC-2.2.8