1DBIx::Class::Storage::TUxsneSrcoCpoenGturairbdu(t3e)d PeDrBlIxD:o:cCulmaesnst:a:tSitoonrage::TxnScopeGuard(3)
2
3
4

NAME

6       DBIx::Class::Storage::TxnScopeGuard - Scope-based transaction handling
7

SYNOPSIS

9        sub foo {
10          my ($self, $schema) = @_;
11
12          my $guard = $schema->txn_scope_guard;
13
14          # Multiple database operations here
15
16          $guard->commit;
17        }
18

DESCRIPTION

20       An object that behaves much like Scope::Guard, but hardcoded to do the
21       right thing with transactions in DBIx::Class.
22

METHODS

24   new
25       Creating an instance of this class will start a new transaction (by
26       implicitly calling "txn_begin" in DBIx::Class::Storage. Expects a
27       DBIx::Class::Storage object as its only argument.
28
29   commit
30       Commit the transaction, and stop guarding the scope. If this method is
31       not called and this object goes out of scope (e.g. an exception is
32       thrown) then the transaction is rolled back, via "txn_rollback" in
33       DBIx::Class::Storage
34

SEE ALSO

36       "txn_scope_guard" in DBIx::Class::Schema.
37
38       Scope::Guard by chocolateboy (inspiration for this module)
39

FURTHER QUESTIONS?

41       Check the list of additional DBIC resources.
42
44       This module is free software copyright by the DBIx::Class (DBIC)
45       authors. You can redistribute it and/or modify it under the same terms
46       as the DBIx::Class library.
47
48
49
50perl v5.38.0                      2023-07D-B2I0x::Class::Storage::TxnScopeGuard(3)
Impressum