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

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

Overview
Comment:Revert to the legacy behavior for nested transactions for the SQLiteTransaction class.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-1f7bfff467
Files: files | file ages | folders
SHA1: a7319029c7455da5c5a0ed8102c0f76edb2242e9
User & Date: mistachkin 2016-11-17 20:14:11
Context
2016-11-17
20:26
Add the 'AllowNestedTransactions' connection flag to enable using SAVEPOINTs to implement nested transactions. check-in: f73c069fb9 user: mistachkin tags: trunk
20:14
Revert to the legacy behavior for nested transactions for the SQLiteTransaction class. Closed-Leaf check-in: a7319029c7 user: mistachkin tags: tkt-1f7bfff467
19:34
Merge updates from trunk. check-in: 821dfae43b user: mistachkin tags: tkt-1f7bfff467
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

   132    132                   {
   133    133                       _cnn._transactionLevel--;
   134    134                       _cnn = null;
   135    135   
   136    136                       throw;
   137    137                   }
   138    138               }
   139         -            else
   140         -            {
   141         -                throw new SQLiteException("Transaction is already active on this connection");
   142         -            }
   143    139           }
   144    140   
   145    141           ///////////////////////////////////////////////////////////////////////////////////////////////
   146    142   
   147    143           /// <summary>
   148    144           /// Issue a ROLLBACK command against the database connection,
   149    145           /// optionally re-throwing any caught exception.

Changes to Tests/tkt-1f7bfff467.eagle.

    66     66           "SELECT x FROM t1 ORDER BY x;"]
    67     67   
    68     68       set result
    69     69     } error
    70     70   
    71     71     extractSystemDataSQLiteExceptionMessage $error
    72     72   } -cleanup {
           73  +  catch {sql transaction rollback $transaction(2)}
    73     74     catch {sql transaction rollback $transaction(1)}
    74     75   
    75     76     cleanupDb $fileName
           77  +
           78  +  catch {removeDbTransaction $transaction(2)}
           79  +  catch {removeDbTransaction $transaction(1)}
    76     80   
    77     81     unset -nocomplain error result transaction db fileName
    78     82   } -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
    79         -System.Data.SQLite} -result {unknown error -- Transaction is already active on\
    80         -this connection}}
           83  +System.Data.SQLite} -result {unknown error -- No transaction is active on this\
           84  +connection}}
    81     85   
    82     86   ###############################################################################
    83     87   
    84     88   runTest {test tkt-1f7bfff467-1.1 {rollback nested transaction} -setup {
    85     89     setupDb [set fileName tkt-1f7bfff467-1.1.db] "" "" "" AllowNestedTransactions
    86     90   } -body {
    87     91     sql execute $db {

Changes to lib/System.Data.SQLite/common.eagle.

  2658   2658         #
  2659   2659         # NOTE: Add the database connection provided by our caller to the list
  2660   2660         #       of those known to the Eagle interpreter.
  2661   2661         #
  2662   2662         object invoke -flags +NonPublic Interpreter.GetActive.connections Add \
  2663   2663             $db $connection
  2664   2664       }
         2665  +
         2666  +    proc removeDbTransaction { transaction } {
         2667  +      #
         2668  +      # NOTE: Remove the database transaction provided by our caller from the
         2669  +      #       list of those known to the Eagle interpreter.
         2670  +      #
         2671  +      object invoke -flags +NonPublic Interpreter.GetActive.transactions \
         2672  +          Remove $transaction
         2673  +    }
  2665   2674   
  2666   2675       proc getRowsFromDataTable { dataTable {valueCallback ""} } {
  2667   2676         set rows [list]
  2668   2677         set count [$dataTable Columns.Count]
  2669   2678   
  2670   2679         for {set index 0} {$index < $count} {incr index} {
  2671   2680           set dataColumn [$dataTable -alias Columns.get_Item $index]