Error when Updating Oracle

Error when Updating Oracle

am 04.12.2007 18:06:42 von IUXO

When updating a table in oracle send me the follow message

Issuing rollback() for database handle being DESTROY'd without
explicit disconnect().

but the update was ok

What is the meaning of this message?

Thanks

Re: Error when Updating Oracle

am 04.12.2007 18:31:05 von Paul Lalli

On Dec 4, 12:06 pm, IUXO wrote:
> When updating a table in oracle send me the follow message
>
> Issuing rollback() for database handle being DESTROY'd without
> explicit disconnect().
>
> but the update was ok
>
> What is the meaning of this message?

It means you didn't call
$dbh->disconnect();
before your program ended, and so DBI has issued
$dbh->rollback();
for you, which, if your RDMS supports transactions correctly, will
undo any changes since you last called
$dbh->commit();
Note, though, that if $dbh->{AutoCommit} is turned on, then all
updates/inserts/deletes are automatically committed, so the rollback()
will have no effect.

When I write DBI applications, I usually include a block similar to
this:

END {
if ($?) { #exiting with error
$dbh->rollback();
} else {
$dbh->commit();
}
$dbh->disconnect();
}

But your mileage may vary.

Paul Lalli