[Catalyst] how to implement Transactions (over different db
tables) in a Catalyst project
Bogdan Lucaciu
bogdan at sinapticode.ro
Mon Jul 6 06:55:52 GMT 2009
On Mon, Jul 6, 2009 at 8:30 AM, <kakimoto at tpg.com.au> wrote:
> How do I do it here in Catalyst/DbiX::Class land?
> I tried to read up the
> http://kobesearch.cpan.org/htdocs/DBIx-Class/DBIx/Class/Storage.html#txn_do
> doc but I can't see how the example can apply to Catalyst.
>
> It says, "$schema->txn_do($coderef)" to get the schema but in catalyst,
> we access the
> database tables directly. For example,
>
>
> my $rs = $c->model('myAppDB::UserSusbcriptions')->search( .. );
>
>
>
> I'm a bit confused and have looked in a few places. Can anyone please
> educate me?
Hello
The info is here http://search.cpan.org/perldoc?Catalyst::Model::DBIC::Schema
# to access schema methods directly:
$c->model('FilmDB')->schema->source(...);
Cheers,
--
Bogdan Lucaciu
http://www.sinapticode.com
More information about the Catalyst
mailing list