X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstringcheck;h=b2c101390589b01daf00d858c60f9d205d05ce83;hp=5ef8971f644b63991af5d6eb5379be7fec1da596;hb=98610392fde2add293bee6199f2de1d6f88559d8;hpb=b83c36dbcfb960638454348fef867f1456329867 diff --git a/yarrg/web/qtextstringcheck b/yarrg/web/qtextstringcheck index 5ef8971..b2c1013 100755 --- a/yarrg/web/qtextstringcheck +++ b/yarrg/web/qtextstringcheck @@ -43,6 +43,7 @@ $format $ctype => undef $string $what +$dbh => undef <%flags> @@ -58,7 +59,8 @@ use CommodsWeb; die if $what =~ m/[^a-z]/; my $chk= $m->fetch_comp("check_${what}"); -my $dbh= dbw_connect($ocean); +my $mydbh; +$dbh ||= ($mydbh= dbw_connect($ocean)); my $sqlstmt= $chk->scall_method("sqlstmt"); my $sth= $dbh->prepare($sqlstmt); @@ -119,7 +121,7 @@ if ($format =~ /dump/) { print Dumper($emsg, $canontext, \@results); } -$dbh->rollback(); +$mydbh->rollback() if $mydbh; return $emsg, $canontext,