diff options
-rwxr-xr-x | libBasicTableOperations.tcl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libBasicTableOperations.tcl b/libBasicTableOperations.tcl index 81f85b3..268845e 100755 --- a/libBasicTableOperations.tcl +++ b/libBasicTableOperations.tcl @@ -110,3 +110,31 @@ proc DeleteColumnFromTable { table columnname } { } } +set isDbTransactionActive false +proc begin_db_transaction { } { + global isDbTransactionActive + if { !$isDbTransactionActive } { + set isDbTransactionActive true + set eval_str [concat BEGIN TRANSACTION] + set err [catch {db eval $eval_str } errStat] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" msg_level_critical + } + } +} + +proc end_db_transaction { } { + global isDbTransactionActive + if { $isDbTransactionActive } { + set isDbTransactionActive false + set eval_str [concat END TRANSACTION] + set err [catch {db eval $eval_str } errStat] + if { $err } { + htmlErrorMsg $errStat + dbg "the following error happen: $errStat" msg_level_critical + } + } +} + + |