[Dbix-class] 'without storage' error with txn_do

Brandon Black blblack at gmail.com
Fri May 25 23:02:12 GMT 2007


On 5/25/07, Eden Cardim <edencardim at gmail.com> wrote:
> On 5/25/07, Jason Konrad <jason at popularmedia.com> wrote:
> > I'm attempting to add transaction support to my Catalyst app which is using
> > DBIx but I am getting this error while trying to execute
> >
> > eval {
> >    $rs = kRadDB->txn_do($coderef);
> > };
> >
> >
> > 'DBIx::Class::Schema::txn_do(): txn_do called on $schema without storage at'
>
> txn_do() isn't a class method, so you need to run it on a connected
> schema instance:
>
>     my $schema = kRadDB->connect(...);
>     $schema->txn_do($coderef);
>

Really since he's using Catalyst, he should be using
Catalyst::Model::DBIC::Schema and then:

$c->model('kRadDB')->schema->txn_do($coderef)



More information about the Dbix-class mailing list