NAME

Rose::DBx::Role::NestTransaction - Nested transactions support for Rose::DB

SYNOPSIS

# 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();
});

DESCRIPTION

This module provides a role for Rose::DB. Just consume the role in your Rose::DB subclass

METHODS

nest_transaction

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 and on success it returns true

AUTHOR

Viktor Turskyi, <koorchik at cpan.org>

BUGS

Please report any bugs or feature requests to Github https://github.com/koorchik/Rose-DBx-Role-NestTransaction

LICENSE AND COPYRIGHT

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.