[Mono-bugs] [Bug 586062] New: SqliteConnection.Close() should raise exception when underlying sqlite3_close() fails

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Mar 6 07:24:26 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=586062

http://bugzilla.novell.com/show_bug.cgi?id=586062#c0


           Summary: SqliteConnection.Close() should raise exception when
                    underlying sqlite3_close() fails
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Mono.Data.Sqlite
        AssignedTo: mhabersack at novell.com
        ReportedBy: philippe at activa.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=346956)
 --> (http://bugzilla.novell.com/attachment.cgi?id=346956)
Patch (DIFF) for Mono.Data.Sqlite_2.0

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8

When calling SqliteConnection.Close(), and the underlying call to
sqlite3_close() returns an error code, there is no error reported.

The code in SqliteConnectionHandle.ReleaseHandle() "eats" the exception raised
by Sqite3.CloseConnection(). This is not correct, and results in a resource
leak (file handle left open).

I've created a patch where the empty catch is removed from ReleaseHandle().
This empty catch has been moved to the SqliteConnection.Dispose() when calling
SqliteConnection.Close(). Reason for this is that it's not good practice to
raise exceptions from Dispose(), but for Close() it's fine (and recommended)


Reproducible: Always

Steps to Reproduce:
1. Open an SqliteConnection
2. Create a SqliteCommand and execute a statement
3. Close the connection (no exception is thrown, but the underlying call to
sqlite3_close() returns SQLITE_BUSY
4. Do this 1,000 times and you'll get "too many open files"

-- 
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