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

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

Overview
Comment:Enhance diagnostics for dealing with handle disposal issues when the connection pool is in use.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0dc37c779eae9c5807dfdcdee97452111b78fc0
User & Date: mistachkin 2012-04-28 08:57:12
Context
2012-04-28
09:45
Add another connection pool related diagnostic. check-in: d846d5cd0b user: mistachkin tags: trunk
08:57
Enhance diagnostics for dealing with handle disposal issues when the connection pool is in use. check-in: e0dc37c779 user: mistachkin tags: trunk
2012-04-24
01:28
Add Visual Studio 2005 support to the design-time component options in the setup. check-in: a47db993dd user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

241
242
243
244
245
246
247


248
249
250
251




252
253
254
255
256
257
258
    }

    internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool)
    {
      if (_sql != null) return;

      _usePool = usePool;


      if (usePool)
      {
        _fileName = strFilename;
        _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion);




      }

      if (_sql == null)
      {
        IntPtr db;

#if !SQLITE_STANDARD







>
>


<

>
>
>
>







241
242
243
244
245
246
247
248
249
250
251

252
253
254
255
256
257
258
259
260
261
262
263
    }

    internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool)
    {
      if (_sql != null) return;

      _usePool = usePool;
      _fileName = strFilename;

      if (usePool)
      {

        _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion);

#if DEBUG && !NET_COMPACT_20
        Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "<null>"));
#endif
      }

      if (_sql == null)
      {
        IntPtr db;

#if !SQLITE_STANDARD

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

89
90
91
92
93
94
95


96
97
98
99




100
101
102
103
104
105
106
    }

    internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool)
    {
      if (_sql != null) return;

      _usePool = usePool;


      if (usePool)
      {
        _fileName = strFilename;
        _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion);




      }

      if (_sql == null)
      {
        IntPtr db;

#if !SQLITE_STANDARD







>
>


<

>
>
>
>







89
90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110
111
    }

    internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool)
    {
      if (_sql != null) return;

      _usePool = usePool;
      _fileName = strFilename;

      if (usePool)
      {

        _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion);

#if DEBUG && !NET_COMPACT_20
        Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "<null>"));
#endif
      }

      if (_sql == null)
      {
        IntPtr db;

#if !SQLITE_STANDARD

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

1426
1427
1428
1429
1430
1431
1432







1433
1434
1435
1436
1437
1438
1439
....
1502
1503
1504
1505
1506
1507
1508







1509
1510
1511
1512
1513
1514
1515
....
1578
1579
1580
1581
1582
1583
1584
1585




1586



#endif
    }

    public override bool IsInvalid
    {
      get { return (handle == IntPtr.Zero); }
    }







  }

  // Provides finalization support for unmanaged SQLite statements.
  internal class SQLiteStatementHandle : CriticalHandle
  {
    public static implicit operator IntPtr(SQLiteStatementHandle stmt)
    {
................................................................................
#endif
    }

    public override bool IsInvalid
    {
      get { return (handle == IntPtr.Zero); }
    }







  }

  // Provides finalization support for unmanaged SQLite backup objects.
  internal class SQLiteBackupHandle : CriticalHandle
  {
      public static implicit operator IntPtr(SQLiteBackupHandle backup)
      {
................................................................................
#endif
      }

      public override bool IsInvalid
      {
          get { return (handle == IntPtr.Zero); }
      }
  }




}










>
>
>
>
>
>
>







 







>
>
>
>
>
>
>







 







|
>
>
>
>
|
>
>
>
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
....
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
....
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
#endif
    }

    public override bool IsInvalid
    {
      get { return (handle == IntPtr.Zero); }
    }

#if DEBUG
    public override string ToString()
    {
        return handle.ToString();
    }
#endif
  }

  // Provides finalization support for unmanaged SQLite statements.
  internal class SQLiteStatementHandle : CriticalHandle
  {
    public static implicit operator IntPtr(SQLiteStatementHandle stmt)
    {
................................................................................
#endif
    }

    public override bool IsInvalid
    {
      get { return (handle == IntPtr.Zero); }
    }

#if DEBUG
    public override string ToString()
    {
        return handle.ToString();
    }
#endif
  }

  // Provides finalization support for unmanaged SQLite backup objects.
  internal class SQLiteBackupHandle : CriticalHandle
  {
      public static implicit operator IntPtr(SQLiteBackupHandle backup)
      {
................................................................................
#endif
      }

      public override bool IsInvalid
      {
          get { return (handle == IntPtr.Zero); }
      }

#if DEBUG
      public override string ToString()
      {
          return handle.ToString();
      }
#endif
  }
}