[Catalyst] Q: DBIC transaction around Catalyst action chain

Bernhard Graf catalyst4 at augensalat.de
Mon Dec 7 14:40:53 GMT 2009


Octavian Râsnita schrieb:

>> having all database access of a Cat action in a database transaction is
>> easy: Wrap everything in $c->model('DB')->schema->txn_do(...) or use
>> Catalyst::Action::DBIC::Transaction.
>>
>> But what to do with action chains?
> 
> Read about txn_begin and txn_commit at:
> 
> http://search.cpan.org/~frew/DBIx-Class-0.08114/lib/DBIx/Class/Storage.pm#txn_begin

Those two map directly to the SQL commands to begin and commit a
transaction. txn_do() uses both internally as well as txn_rollback() and
 is much more powerfull and convenient (supports nesting and automatic
rollback).



More information about the Catalyst mailing list