[Catalyst] Re: transactions with DBIx::Class model

Ansgar Burchardt ansgar at 2008.43-1.org
Thu Aug 7 00:11:30 BST 2008


Hi,

Johannes Plunien <plu at pqpq.de> writes:

> On 02.08.2008, at 18:34, Ansgar Burchardt wrote:
>> The C::M::DBIC::Schema documentation says that I should be able to
>> access the schema object via $c->model("MyApp::Something")->schema,
>> but
>> if I do so I get the following error:
>>
>>    Can't locate object method "schema" via package
>>    "DBIx::Class::ResultSet"
>
> let's say your model is called 'FilmDB' and you got an 'Actor' schema/
> table. I guess you did something like $c->model('FilmDB::Actor')- 
>> schema->txn_do - right? Please try instead $c->model('FilmDB')- 
>>schema->txn_do(...).
>
>   # to access schema methods directly:
>   $c->model('FilmDB')->schema->source(...);

It works this way.  I somehow missed the difference in the
documentation.  Thanks for your help.

Regards,
Ansgar

-- 
PGP: 1024D/595FAD19  739E 2D09 0969 BEA9 9797  B055 DDB0 2FF7 595F AD19



More information about the Catalyst mailing list