]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
tcl daemons: Move BEGIN within scope of transaction error trapping
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 1 Jul 2016 11:10:27 +0000 (12:10 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Jul 2016 12:24:22 +0000 (13:24 +0100)
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

index 6eabeb65a9166bb5ec5e31d746ceebb3ebcd2816..363a8773924651f3fb2c51f40852f2fcc6529397 100644 (file)
@@ -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