diff mbox

[OSSTEST,19/33] tcl daemons: Move BEGIN within scope of transaction error trapping

Message ID 1468002385-4407-20-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson July 8, 2016, 6:26 p.m. UTC
If the db connection has failed, BEGIN will fail.  We want to to
handle this properly.

Right now the effect is that we will now close the connection and it
will then be reopened by the next command.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tcl/JobDB-Executive.tcl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 29ab59a..f2322c4 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -284,8 +284,8 @@  proc transaction {tables script} {
     db-open
     while 1 {
         set ol {}
-        db-execute BEGIN
 	set rc [catch {
+	    db-execute BEGIN
 	    db-execute "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
 	    lock-tables $tables
 	    uplevel 1 $script