[CDBI] class::dbi::loader and transaction

James. L perlwle at yahoo.com
Tue Nov 21 15:53:48 GMT 2006


i am new to class::dbi and using class::dbi::loader
for simple db stuff. i read the cdbi page about
transaction and it mention that with:

  Music::DBI->do_transaction( sub {
    my $artist = Music::Artist->insert({ name => 'Pink
Floyd' });
    my $cd = $artist->add_to_cds({ 
      title => 'Dark Side Of The Moon', 
      year => 1974,

package Music::DBI;
  use base 'Class::DBI';
'username', 'password');

what i have in class::dbi::loader is that i am
operating on two tables and if the last action failed,
roll back all the changes. in do_transaction, i can
only pass a particular table class but it won't roll
back the changes on other tables when failed. 

I guess that i need a base class like Music::DBI or


Sponsored Link

Mortgage rates near 39yr lows. 
$310k for $999/mo. Calculate new payment! 

More information about the ClassDBI mailing list