[CDBI] Class-DBI on Apache/MS-Windows

Karjala karjala_lists at karjala.org
Mon Mar 20 23:11:15 GMT 2006

Matt S Trout wrote:
> Right. DBIx-Class latest dev release (which should be 0.06 shortly) 
> has fixes so it handles this fine; if you need this from Class::DBI 
> you could either copy of the DBIx-Class code for it into a custom 
> db_Main or just make sure you do
> MyClass::DBI->db_Main->disconnect;

I can't get this trick to work. Here's my module's code:

package MyClass::DBI;
use base 'Class::DBI::mysql';
__PACKAGE__->set_db('Main', 'dbi:mysql:myclass', 'web', 'password', { 
AutoCommit => 1 });
use overload
    '==' => sub { shift->stringify_self == shift },
    '!=' => sub { shift->stringify_self != shift };

package MyClass::User;
use base 'MyClass::DBI';


I tried adding MyClass::DBI->db_Main->disconnect in this file, just 
before the "1;" but nothing changed and same error occurrs.
I also tried adding the disconnect line inside the <Perl> block in 
Apache.conf, but nothing changed there also.

What is wrong? Could it be that I'm using CDBI::mysql instead of CDBI?

- K.

> at the end of your setup code before apache starts spawning threads.

More information about the ClassDBI mailing list