diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-08 20:51:56 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2013-12-08 20:51:56 -0500 |
commit | a676708d39b2c81e19e767c86b8509a0d6f7600f (patch) | |
tree | 9b9c812bf5eaf84c95629b083afe1b012c8e4783 | |
parent | 4786dc137a5e861f10ccf68c581c3dfb46ae1252 (diff) | |
download | GradeBook-a676708d39b2c81e19e767c86b8509a0d6f7600f.tar.gz GradeBook-a676708d39b2c81e19e767c86b8509a0d6f7600f.zip |
added begin and end db transaction functions
-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 + } + } +} + + |