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  -  MOOSEX::TRANSACTIONALMETHODS (3)

.ds Aq ’

NAME

MooseX::TransactionalMethods - Syntax sugar for transactional methods

CONTENTS

SYNOPSIS



  package Foo::Bar;
  use MooseX::TransactionalMethods; # includes Moose
 
  has schema => (is => ro);
 
  transactional foo => sub {
     # this is going to happen inside a transaction
  };



DESCRIPTION

This method exports the transactional declarator that will enclose the method in a txn_do call.

DECLARATOR

transactional $name => $code When you declare with only the name and the coderef, the wrapper will call ’schema’ on your class to fetch the schema object on which it will call txn_do to enclose your coderef.
transactional $name => $schema, $code When you declare sending the schema object, it will store it in the method metaclass and use it directly without any calls to this object.

NOTE THAT MIXING DECLARTIONS WITH SCHEMA AND WITHOUT SCHEMA WILL LEAD TO PAINFULL CONFUSION SINCE THE WRAPPING IS SPECIFIC TO THAT CLASS AND THE BEHAVIOR IS NOT MODIFIED WHEN YOU OVERRIDE THE METHOD. PREFER USING THE DYNAMIC DECLARATOR WHEN POSSIBLE.

AUTHORS

Daniel Ruoso <daniel@ruoso.com>

With help from rafl and doy from #moose.

COPYRIGHT AND LICENSE

Copyright 2010 by Daniel Ruoso et al

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOOSEX::TRANSACTIONALMETHODS (3) 2015-03-26

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