On Wed, Feb 11, 2004 at 09:35:59AM +0000, Tim Bunce wrote:
>
> The warning as it's a significant satefy feature, however it can be
> turned off, along with various other warnings, by $dbh->{Warn} = 0,
> but I don't recommend that.
>
> Tim.
>
> p.s. The plan is to have a way for a driver to indicate if it's in a
> transaction and, for drivers that can, use that to skip the warning.
Here's what I've added to DBI 1.41:
=item C<Executed> (boolean)
The C<Executed> attribute is true if the handle object has been "executed".
Currently only the $dbh do() method and the $sth execute(), execute_array(),
and execute_for_fetch() methods set the C<Executed> attribute.
When it's set on a handle it is also set on the parent handle at the
same time. So calling execute() on a $sth also sets the C<Executed>
attribute on the parent $dbh.
The C<Executed> attribute for a $dbh is cleared by the commit() and
rollback() methods. The C<Executed> attribute of a statement handle
is not cleared by the DBI under any circumstances and so acts as a
permenant record of whether the statement handle was ever used.
=cut
The "Issuing rollback()" is suppressed if Executed is false
(as it would be after a commit).
Anyone who wants more is welcome to send a patch :)
Tim.