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 Unified Diffs Ignore Whitespace Patch

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

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
                {
                    _cnn._transactionLevel--;
                    _cnn = null;

                    throw;
                }
            }
            else
            {
                throw new SQLiteException("Transaction is already active on this connection");
            }
        }

        ///////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Issue a ROLLBACK command against the database connection,
        /// optionally re-throwing any caught exception.







<
<
<
<







132
133
134
135
136
137
138




139
140
141
142
143
144
145
                {
                    _cnn._transactionLevel--;
                    _cnn = null;

                    throw;
                }
            }




        }

        ///////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Issue a ROLLBACK command against the database connection,
        /// optionally re-throwing any caught exception.

Changes to Tests/tkt-1f7bfff467.eagle.

66
67
68
69
70
71
72

73
74
75



76
77
78
79
80
81
82
83
84
85
86
87
        "SELECT x FROM t1 ORDER BY x;"]

    set result
  } error

  extractSystemDataSQLiteExceptionMessage $error
} -cleanup {

  catch {sql transaction rollback $transaction(1)}

  cleanupDb $fileName




  unset -nocomplain error result transaction db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {unknown error -- Transaction is already active on\
this connection}}

###############################################################################

runTest {test tkt-1f7bfff467-1.1 {rollback nested transaction} -setup {
  setupDb [set fileName tkt-1f7bfff467-1.1.db] "" "" "" AllowNestedTransactions
} -body {
  sql execute $db {







>



>
>
>



|
|







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
        "SELECT x FROM t1 ORDER BY x;"]

    set result
  } error

  extractSystemDataSQLiteExceptionMessage $error
} -cleanup {
  catch {sql transaction rollback $transaction(2)}
  catch {sql transaction rollback $transaction(1)}

  cleanupDb $fileName

  catch {removeDbTransaction $transaction(2)}
  catch {removeDbTransaction $transaction(1)}

  unset -nocomplain error result transaction db fileName
} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {unknown error -- No transaction is active on this\
connection}}

###############################################################################

runTest {test tkt-1f7bfff467-1.1 {rollback nested transaction} -setup {
  setupDb [set fileName tkt-1f7bfff467-1.1.db] "" "" "" AllowNestedTransactions
} -body {
  sql execute $db {

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

2658
2659
2660
2661
2662
2663
2664









2665
2666
2667
2668
2669
2670
2671
      #
      # NOTE: Add the database connection provided by our caller to the list
      #       of those known to the Eagle interpreter.
      #
      object invoke -flags +NonPublic Interpreter.GetActive.connections Add \
          $db $connection
    }









 
    proc getRowsFromDataTable { dataTable {valueCallback ""} } {
      set rows [list]
      set count [$dataTable Columns.Count]

      for {set index 0} {$index < $count} {incr index} {
        set dataColumn [$dataTable -alias Columns.get_Item $index]







>
>
>
>
>
>
>
>
>







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

      for {set index 0} {$index < $count} {incr index} {
        set dataColumn [$dataTable -alias Columns.get_Item $index]