Index: System.Data.SQLite/SQLite3.cs ================================================================== --- System.Data.SQLite/SQLite3.cs +++ System.Data.SQLite/SQLite3.cs @@ -128,13 +128,14 @@ { _sql = new SQLiteConnectionHandle(db, ownHandle); _fileName = fileName; SQLiteConnection.OnChanged(null, new ConnectionEventArgs( - SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, _sql, fileName, new object[] { fmt, kind, - fmtString, db, fileName, ownHandle })); + SQLiteConnectionEventType.NewCriticalHandle, null, + null, null, null, _sql, fileName, new object[] { + typeof(SQLite3), fmt, kind, fmtString, db, fileName, + ownHandle })); } } /////////////////////////////////////////////////////////////////////////////////////////////// @@ -242,10 +243,15 @@ DisposeModules(); #endif SQLiteConnectionPool.Add(_fileName, _sql, _poolVersion); + SQLiteConnection.OnChanged(null, new ConnectionEventArgs( + SQLiteConnectionEventType.ClosedToPool, null, null, + null, null, _sql, _fileName, new object[] { + typeof(SQLite3), canThrow, _fileName, _poolVersion })); + #if !NET_COMPACT_20 && TRACE_CONNECTION Trace.WriteLine(String.Format("Close (Pool) Success: {0}", _sql)); #endif } #if !NET_COMPACT_20 && TRACE_CONNECTION @@ -756,10 +762,16 @@ if (usePool) { _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); + SQLiteConnection.OnChanged(null, new ConnectionEventArgs( + SQLiteConnectionEventType.OpenedFromPool, null, null, + null, null, _sql, strFilename, new object[] { + typeof(SQLite3), strFilename, vfsName, connectionFlags, + openFlags, maxPoolSize, usePool })); + #if !NET_COMPACT_20 && TRACE_CONNECTION Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "")); #endif } @@ -795,13 +807,14 @@ _sql = new SQLiteConnectionHandle(db, true); } lock (_sql) { /* HACK: Force the SyncBlock to be "created" now. */ } SQLiteConnection.OnChanged(null, new ConnectionEventArgs( - SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, _sql, strFilename, new object[] { strFilename, - vfsName, connectionFlags, openFlags, maxPoolSize, usePool })); + SQLiteConnectionEventType.NewCriticalHandle, null, + null, null, null, _sql, strFilename, new object[] { + typeof(SQLite3), strFilename, vfsName, connectionFlags, + openFlags, maxPoolSize, usePool })); } // Bind functions to this connection. If any previous functions of the same name // were already bound, then the new bindings replace the old. if ((connectionFlags & SQLiteConnectionFlags.NoBindFunctions) != SQLiteConnectionFlags.NoBindFunctions) @@ -1186,12 +1199,12 @@ if (statementHandle != null) { SQLiteConnection.OnChanged(null, new ConnectionEventArgs( SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, statementHandle, strSql, new object[] { cnn, - strSql, previous, timeoutMS })); + null, null, statementHandle, strSql, new object[] { + typeof(SQLite3), cnn, strSql, previous, timeoutMS })); } if (ShouldThrowForCancel()) { if ((n == SQLiteErrorCode.Ok) || @@ -2616,13 +2629,13 @@ backupHandle = new SQLiteBackupHandle(destHandle, backup); } SQLiteConnection.OnChanged(null, new ConnectionEventArgs( - SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, backupHandle, null, new object[] { destCnn, - destName, sourceName })); + SQLiteConnectionEventType.NewCriticalHandle, null, + null, null, null, backupHandle, null, new object[] { + typeof(SQLite3), destCnn, destName, sourceName })); return new SQLiteBackup( this, backupHandle, destHandle, zDestName, sourceHandle, zSourceName); } Index: System.Data.SQLite/SQLite3_UTF16.cs ================================================================== --- System.Data.SQLite/SQLite3_UTF16.cs +++ System.Data.SQLite/SQLite3_UTF16.cs @@ -150,10 +150,16 @@ if (usePool) { _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); + SQLiteConnection.OnChanged(null, new ConnectionEventArgs( + SQLiteConnectionEventType.OpenedFromPool, null, null, + null, null, _sql, strFilename, new object[] { + typeof(SQLite3_UTF16), strFilename, vfsName, + connectionFlags, openFlags, maxPoolSize, usePool })); + #if !NET_COMPACT_20 && TRACE_CONNECTION Trace.WriteLine(String.Format("Open16 (Pool): {0}", (_sql != null) ? _sql.ToString() : "")); #endif } @@ -204,13 +210,14 @@ _sql = new SQLiteConnectionHandle(db, true); } lock (_sql) { /* HACK: Force the SyncBlock to be "created" now. */ } SQLiteConnection.OnChanged(null, new ConnectionEventArgs( - SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, _sql, strFilename, new object[] { strFilename, - vfsName, connectionFlags, openFlags, maxPoolSize, usePool })); + SQLiteConnectionEventType.NewCriticalHandle, null, + null, null, null, _sql, strFilename, new object[] { + typeof(SQLite3_UTF16), strFilename, vfsName, + connectionFlags, openFlags, maxPoolSize, usePool })); } // Bind functions to this connection. If any previous functions of the same name // were already bound, then the new bindings replace the old. if ((connectionFlags & SQLiteConnectionFlags.NoBindFunctions) != SQLiteConnectionFlags.NoBindFunctions) Index: System.Data.SQLite/SQLiteConnection.cs ================================================================== --- System.Data.SQLite/SQLiteConnection.cs +++ System.Data.SQLite/SQLiteConnection.cs @@ -968,12 +968,13 @@ } if (result != null) { SQLiteConnection.OnChanged(null, new ConnectionEventArgs( - SQLiteConnectionEventType.NewCriticalHandle, null, null, - null, null, result, null, new object[] { nativeHandle })); + SQLiteConnectionEventType.NewCriticalHandle, null, + null, null, null, result, null, new object[] { + typeof(SQLiteConnection), nativeHandle })); } return result; } Index: System.Data.SQLite/SQLiteConvert.cs ================================================================== --- System.Data.SQLite/SQLiteConvert.cs +++ System.Data.SQLite/SQLiteConvert.cs @@ -2210,11 +2210,21 @@ DisposingDataReader = 13, /// /// A data reader is being closed. /// - ClosingDataReader = 14 + ClosingDataReader = 14, + + /// + /// A native resource was opened (i.e. obtained) from the pool. + /// + OpenedFromPool = 15, + + /// + /// A native resource was closed (i.e. released) to the pool. + /// + ClosedToPool = 16 } /// /// This implementation of SQLite for ADO.NET can process date/time fields in /// databases in one of six formats.