System.Data.SQLite
Check-in [1045210882]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the SQLiteBase.ResetConnection method throw an exception if the connection handle is closed or invalid.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1045210882a7e2c8c7bdeda45aa173536d4824cd
User & Date: mistachkin 2012-10-06 05:57:32
Context
2012-10-06
05:58
Remove superfluous Unicode related defines in the native project files. check-in: e84d4d5613 user: mistachkin tags: trunk
05:57
Make the SQLiteBase.ResetConnection method throw an exception if the connection handle is closed or invalid. check-in: 1045210882 user: mistachkin tags: trunk
04:38
Implement column name/index caching in the SQLiteDataReader class. check-in: bdd8e44fd0 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteBase.cs.

554
555
556
557
558
559
560
561
562
563
564
565
566
567






568
569
570
571
572
573
574
            if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError(hdl, db));
        }
    }

    internal static void ResetConnection(SQLiteConnectionHandle hdl, IntPtr db)
    {
        if ((hdl == null) || (db == IntPtr.Zero)) return;
        if (hdl.IsClosed || hdl.IsInvalid) return;
#if PLATFORM_COMPACTFRAMEWORK
        lock (hdl.syncRoot)
#else
        lock (hdl)
#endif
        {






            IntPtr stmt = IntPtr.Zero;
            SQLiteErrorCode n;
            do
            {
                stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
                if (stmt != IntPtr.Zero)
                {







<






>
>
>
>
>
>







554
555
556
557
558
559
560

561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
            if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError(hdl, db));
        }
    }

    internal static void ResetConnection(SQLiteConnectionHandle hdl, IntPtr db)
    {
        if ((hdl == null) || (db == IntPtr.Zero)) return;

#if PLATFORM_COMPACTFRAMEWORK
        lock (hdl.syncRoot)
#else
        lock (hdl)
#endif
        {
            if (hdl.IsInvalid)
                throw new InvalidOperationException("The connection handle is invalid.");

            if (hdl.IsClosed)
                throw new InvalidOperationException("The connection handle is closed.");

            IntPtr stmt = IntPtr.Zero;
            SQLiteErrorCode n;
            do
            {
                stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt);
                if (stmt != IntPtr.Zero)
                {