Rose::DBx::Role::NestTransaction - Nested transactions support for Rose::DB
# Define yout DB class package MyDB; use base 'Rose::DB'; use Role::Tiny::With; with 'Rose::DBx::Role::NestTransaction'; # Somewhere in your code MyDB->new_or_cached->nest_transaction(sub { User->new( name => 'name' )->save(); });
This module provides a role for Rose::DB. Just consume the role in your Rose::DB subclass
These methods behaves like do_transaction but it repects existing transactions and do not start new one if the transaction already started. On error it revert transaction and rethrow error
Viktor Turskyi, <koorchik at cpan.org>
<koorchik at cpan.org>
Please report any bugs or feature requests to Github https://github.com/koorchik/Rose-DBx-Role-NestTransaction
Copyright 2012 Viktor Turskyi.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Rose::DBx::Role::NestTransaction, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rose::DBx::Role::NestTransaction
CPAN shell
perl -MCPAN -e shell install Rose::DBx::Role::NestTransaction
For more information on module installation, please visit the detailed CPAN module installation guide.