NAME

Egg::Plugin::DBI::CommitOK - DBI->commit is settled and it does.

SYNOPSIS

  package MYPROJECT;
  use strict;
  use Egg qw/DBI::CommotOK/;

Example of code.

  my($e)= @_;
  .... ban, ban, ban.
  
  my $sth= $e->dbh->prepare(q{ update table set foo = ? where baa = ? });
  $sth->execute('foo_value', 'baa_value');
  $sth->finish;
  $e->commit_ok(1);
  #
  # Actual $e->dbh->commit is done by $e->finalize after this.
  #

DESCRIPTION

When commit_ok is false, rollback is always done.

When dbh->{AutoCommit} is effective, nothing is done.

When the error occurs by the application, rollback is done via finalize_error.

METHODS

$e->dbh

It is an accessor to $e->model('DBI')->dbh.

$e->commit_ok([Boolean]);

It is a flag whether to do dbh->commit.

$e->rollback_ok([Boolean]);

It is a flag whether to do dbh->rollback.

$e->dbh_commit

$e->dbh->ommit is done at once. However, nothing is done when dbh->{AutoCommit} is effective.

$e->dbh_rollback

$e->dbh->rollback is done at once. However, nothing is done when dbh->{AutoCommit} is effective.

SEE ALSO

Egg::Model::DBI, Egg::Release,

AUTHOR

Masatoshi Mizuno <mizuno@bomcity.com>

COPYRIGHT

Copyright (C) 2006 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.