[Dbix-class] Class::DBI vs DBIx and CDBICompat

Steven Mackenzie dbix at aptile.co.uk
Fri Jun 23 15:02:48 CEST 2006


I stumbled upon this piece of documentation:

Which suggests that I can start using DBIx::Class simply my making this
change to my Class::DBI code:

# In DBBase.pm
#use base qw( Class::DBI ); # currently using 3.0.6 from ActiveState ppm.
use base qw/DBIx::Class/; # currently 0.6000 from ActiveState pmm
__PACKAGE__->load_components( qw/CDBICompat Core DB/ );

This seemed worth a try, to see if my app might start making fewer calls
to the DB perhaps :-)

However, I get this error at startup:
Can't locate object method "set_db" via package "DBBase" at
C:\xyz\InitDatabase.pm line 33.

In my application I make the call to the Class::DBI method set_db via my
DBBase.pm module, like this:
    $dsn, # passed in by caller
    {RaiseError => 1,
     AutoCommit => 0, # Don't autocommit transactions
     unicode => 1}

It seems that this isn't part of the emulated funcionality, and so I
have two questions:

How can I set the DBIx::Class DB connection?

Is there any possible reduction in DB traffic to be gained by using
DBIxC over CDBI?

Thanks in advance for any tips or pointers,

More information about the Dbix-class mailing list