System.Data.SQLite
Check-in [1d3fab1dd9]
Not logged in

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

Overview
Comment:More coding style changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1d3fab1dd904a4e3c20d44b38e00d0a5c3ef6c9b
User & Date: mistachkin 2016-11-04 00:15:01
Context
2016-11-04
00:17
Yet more coding style changes. check-in: 527eeeec4c user: mistachkin tags: trunk
00:15
More coding style changes. check-in: 1d3fab1dd9 user: mistachkin tags: trunk
00:13
Make whitespace uniform. check-in: 845fa69297 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

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

     8      8   namespace System.Data.SQLite
     9      9   {
    10     10       using System;
    11     11       using System.Data;
    12     12       using System.Data.Common;
    13     13       using System.Threading;
    14     14   
           15  +    ///////////////////////////////////////////////////////////////////////////////////////////////
           16  +
    15     17       /// <summary>
    16     18       /// SQLite implementation of DbTransaction.
    17     19       /// </summary>
    18     20       public sealed class SQLiteTransaction : DbTransaction
    19     21       {
    20     22           /// <summary>
    21     23           /// The connection to which this transaction is bound
    22     24           /// </summary>
    23     25           internal SQLiteConnection _cnn;
    24         -        internal int _version; // Matches the version of the connection
           26  +
           27  +        /// <summary>
           28  +        /// Matches the version of the connection.
           29  +        /// </summary>
           30  +        private int _version;
           31  +
           32  +        /// <summary>
           33  +        /// The isolation level for this transaction.
           34  +        /// </summary>
    25     35           private IsolationLevel _level;
           36  +
           37  +        ///////////////////////////////////////////////////////////////////////////////////////////////
    26     38   
    27     39           /// <summary>
    28     40           /// Constructs the transaction object, binding it to the supplied connection
    29     41           /// </summary>
    30     42           /// <param name="connection">The connection to open a transaction on</param>
    31     43           /// <param name="deferredLock">TRUE to defer the writelock, or FALSE to lock immediately</param>
    32     44           internal SQLiteTransaction(SQLiteConnection connection, bool deferredLock)
................................................................................
   132    144                       cmd.ExecuteNonQuery();
   133    145                   }
   134    146               }
   135    147               _cnn._transactionLevel--;
   136    148               _cnn = null;
   137    149           }
   138    150   
          151  +        ///////////////////////////////////////////////////////////////////////////////////////////////
          152  +
   139    153           /// <summary>
   140    154           /// Returns the underlying connection to which this transaction applies.
   141    155           /// </summary>
   142    156           public new SQLiteConnection Connection
   143    157           {
   144    158               get { CheckDisposed(); return _cnn; }
   145    159           }
          160  +
          161  +        ///////////////////////////////////////////////////////////////////////////////////////////////
   146    162   
   147    163           /// <summary>
   148    164           /// Forwards to the local Connection property
   149    165           /// </summary>
   150    166           protected override DbConnection DbConnection
   151    167           {
   152    168               get { return Connection; }
   153    169           }
   154    170   
          171  +        ///////////////////////////////////////////////////////////////////////////////////////////////
          172  +
   155    173           /// <summary>
   156    174           /// Gets the isolation level of the transaction.  SQLite only supports Serializable transactions.
   157    175           /// </summary>
   158    176           public override IsolationLevel IsolationLevel
   159    177           {
   160    178               get { CheckDisposed(); return _level; }
   161    179           }
          180  +
          181  +        ///////////////////////////////////////////////////////////////////////////////////////////////
   162    182   
   163    183           /// <summary>
   164    184           /// Rolls back the active transaction.
   165    185           /// </summary>
   166    186           public override void Rollback()
   167    187           {
   168    188               CheckDisposed();
   169    189               SQLiteConnection.Check(_cnn);
   170    190               IsValid(true);
   171    191               IssueRollback(true);
   172    192           }
          193  +
          194  +        ///////////////////////////////////////////////////////////////////////////////////////////////
   173    195   
   174    196           internal void IssueRollback(bool throwError)
   175    197           {
   176    198               SQLiteConnection cnn = Interlocked.Exchange(ref _cnn, null);
   177    199   
   178    200               if (cnn != null)
   179    201               {
................................................................................
   189    211                   {
   190    212                       if (throwError)
   191    213                           throw;
   192    214                   }
   193    215                   cnn._transactionLevel = 0;
   194    216               }
   195    217           }
          218  +
          219  +        ///////////////////////////////////////////////////////////////////////////////////////////////
   196    220   
   197    221           internal bool IsValid(bool throwError)
   198    222           {
   199    223               if (_cnn == null)
   200    224               {
   201    225                   if (throwError == true) throw new ArgumentNullException("No connection associated with this transaction");
   202    226                   else return false;