> Now the memory problem has gone away..but at some point my handles ALL
> start getting the above and I don't understand HOW to end the
> transaction block...I am only running and retrieving queries...do I
Do you really need the transactions?
> still need to do a commit at some point to close the transaction
> block? my queries run like the following:
It would probably be a good Idea. I don't think you want your
transactions presisting accross requests. dbh->rollback(), will rollback
the current transaction and start a new one, if you do not want to do a
commit.
>
> $sth=$db->prepare(qq($query));
> $result=$sth->execute;
> $rows=$sth->rows;
> $err=$sth->err;
> $errstr=$sth->errstr;
> $sth->finish();
>
>
> The real crux is this: ONLY The FIRST query with an ERROR returns an
> error...after that it ACTS like everything is normal, but isn't even
> getting acknowledgement from the $db...other than that $rows changes
> from "-1" to "-2"; (Which I assume is an Error of sorts but I'd
> rather see an error in $h->err or $h-errstr;)
>
> I tried haveing RaiesError=>1 in my connect string and EVALing the
> statement...but the statement was never executing at all...I took the
> eval out, and it would DIE on an error..but it would execute.
>
Try something like this:
with RaseError set to 1
eval {
$p = $dbh->prep($q);
$p->execute();
$data = $p->fetchall_arrayref();
}; if ($@) {
print STDERR "ERR:$@\n";
$dbh->rollback();
}
#
## do some stuff with $data
#
-Rudy