GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::TRANSACTIONMANAGER::DEVELOPERS (3)

.ds Aq ’

NAME

DBIx::TransactionManager::Developers - docs for developers

CONTENTS

DESCRIPTION

This document describes a document for O/R mapper writer and/or DBIx::* writer.

MORE DOCUMETNS for DBIx::TransactionManager class

my $txn = $tm->txn_scope(%args) Create a new DBIx::TransactionManager::ScopeGuard’s instance object.

You can pass an optional argument to %args, to tell the scope guard where the scope was generated, like so:



    package Foo;
    use Moose;
    sub mymethod {
        my $self = shift;
        my $txn = $tm->txn_scope( caller => [ caller() ] );
        return $txn;
    }

    package main;
    my $obj = Foo->new();
    my $txn = $obj->mymethod();



This will allow the guard object to report the caller’s location from the perspective of mymethod(), not where txn_scope() was called.

see DBIx::TransactionManager::ScopeGuard’s METHODS

$tm->txn_begin(%args) Start the transaction.

txn_begin may optionally take a ’caller’ argument. This will allow you to provide caller information which will be used in in_transaction. For example if you have a wrapper function that calls txn_begin, you may want to let the user think that the caller was one stack above your wrapper.



    # use __my__ caller!
    $tm->txn_begin( caller => [ caller(0) ] );



$tm->txn_commit() Commit the current transaction.

If the $dbh is in a nested transaction, TransactionManager doesn’t do COMMIT at here. TM just poped transaction stack and do nothing.

$tm->txn_rollback() Rollback the current transaction.

If the $dbh is in a nested transaction, TransactionManager doesn’t do ROLLBACK at here. TM just poped transaction stack and do nothing.

$tm->in_transaction() : Bool Returns true if $txn is currently in a middle of a transaction. While normally you only need to use this value as a boolean, it actually returns a hashref consisting of ’caller’ and ’pid’ element. This will tell you exactly where the currently valid transaction started.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::TRANSACTIONMANAGER::DEVELOPERS (3) 2014-05-29

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.