[Catalyst] Q: DBIC transaction around Catalyst action chain

Bernhard Graf catalyst4 at augensalat.de
Mon Dec 7 11:42:06 GMT 2009


Hi,

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?

 /user/id/42/item/id/23/save

User data is fetched in C:C:User::id() (and stored onto the stash), item
data is fetched in C:C:Item::id() and finally (if all checks are
successfull) item data is written in C:C:Item::save().

How can I wrap the whole action chain into a DBIC transaction?

Bernhard Graf




More information about the Catalyst mailing list