diff options
-rwxr-xr-x | GradeBook.tcl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl index 5bff792..cb7ddf4 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -86,9 +86,29 @@ if { [file exists $dbfile] && ("$coursedbfname" ne "") } { htmlHeader puts "<body>" sqlite3 db $dbfile + + # we will do everything with in one transaction + # otherwise I see performance degradation on some computers + # when there are a lot if update statements + 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 + } + set permission_list [ AccessGroupRights db $user ] htmlTop $permission_list ChoseAction $action $permission_list $user + + # ending transaction right before closing database + 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 + } + db close } else { htmlHeaderDBSelector |