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

Matt S Trout dbix-class at trout.me.uk
Mon Mar 20 21:48:48 GMT 2006


Perrin Harkins wrote:
> On Mon, 2006-03-20 at 22:35 +0200, Karjala wrote:
>> I was wondering 1) whether anyone has gotten Class::DBI to work on
>> such a setup (Apache on Win is threaded only, 1 process)
> 
> I don't know, but it should work if the database libraries and DBD are
> thread-safe.
> 
>> On "2": I tried placing "use MyClass::DBI;" in a <Perl> section just
>> before the virtual server's configuration, but that doesn't work (I
>> get the following error
> 
> That error means you opened the connection before the threads were
> spawned and two threads tried to use it.  Don't do that.

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;

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

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +




More information about the ClassDBI mailing list