++ed by:
NEYASOV PINGAN PTOP HARRYL JHTHORSEN

18 PAUSE users
16 non-PAUSE users.

Author image Jan Henning Thorsen
and 4 contributors

NAME

Mojo::mysql::Transaction - Transaction

SYNOPSIS

  use Mojo::mysql::Transaction;

  my $tx = Mojo::mysql::Transaction->new(db => $db);
  $tx->commit;

DESCRIPTION

Mojo::mysql::Transaction is a cope guard for DBD::mysql transactions used by Mojo::mysql::Database.

ATTRIBUTES

Mojo::mysql::Transaction implements the following attributes.

db

  my $db = $tx->db;
  $tx    = $tx->db(Mojo::mysql::Database->new);

Mojo::mysql::Database object this transaction belongs to.

METHODS

Mojo::mysql::Transaction inherits all methods from Mojo::Base and implements the following new ones.

commit

  $tx = $tx->commit;

Commit transaction.

new

  my $tx = Mojo::mysql::Transaction->new;

Construct a new Mojo::mysql::Transaction object.

SEE ALSO

Mojo::mysql.