X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstringcheck;h=b2c101390589b01daf00d858c60f9d205d05ce83;hb=f6d7a4d627f3ecc0624649bb895dbf8e59afcf47;hp=5ef8971f644b63991af5d6eb5379be7fec1da596;hpb=9d01242d0991d15f7ea84454264c868e1c4ed8ad;p=ypp-sc-tools.db-live.git 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,