[Mono-bugs] [Bug 499864] New: Dispose-Method of Mono.Data.SqliteClient.SqliteConnection doesn't close the connection.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 30 13:29:00 EDT 2009


           Summary: Dispose-Method of
                    Mono.Data.SqliteClient.SqliteConnection doesn't close
                    the connection.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Mono.Data.Sqlite
        AssignedTo: mhabersack at novell.com
        ReportedBy: daniel at hofmannmail.ath.cx
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:
Gecko/2009030810 Iceweasel/3.0.7 (Debian-3.0.7-1)

There's no component for the old Sqlite-Bindings (Mono.Data.SqliteClient), only
the new Mono.Data.Sqlite. Anyway, this bug concerns only the old!
Sqlite-bindings and is easily worked around:

The following testcase shows the problem. On my system this results in an
exception because no more handles can be allocated. Calling Close () manually
is an easy workaround, that makes the exception disappear in the example.

Compile with:
gmcs gert.cs -r:System.Data -r:Mono.Data.SqliteClient

public class M {
  public static void Main () {
    for (int i = 0; i < 10000; i++) {
      using (System.Data.IDbConnection conn = new
Mono.Data.SqliteClient.SqliteConnection ()) {
        conn.ConnectionString = "version=3,mode=600,URI=file:/tmp/testdb";
        conn.Open ();
        using (System.Data.IDbCommand c = conn.CreateCommand ()) {
          c.CommandText = "CREATE TABLE IF NOT EXISTS a (id INTEGER);";
          c.ExecuteNonQuery ();
        //conn.Close ();

    //System.Diagnostics.Process.Start ("sh -c 'ls -l /proc/$PPID/fd/ | wc
-l'").WaitForExit ();

The problem also persists on r133188 from trunk.

Reproducible: Always

Steps to Reproduce:

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list