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

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


I have to make a website on Apache for Windows 2k (Apache v2.0.x)

I was wondering 1) whether anyone has gotten Class::DBI to work on such 
a setup (Apache on Win is threaded only, 1 process)

and

2) where should I place the "use MyClass::DBI;" statement?

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:


*error:*  	DBD::mysql::db FETCH failed: handle 2 is owned by thread 
d44014 not current thread 159212c (handles can't be shared between 
threads and your driver may need a CLONE method added) at 
C:/apacheperl/Perl/site/lib/Ima/DBI.pm line 316.
*context:*  	
*...*  	
*312:*  	sub _mk_db_closure {
*313:*  	my ($class, @connection) = @_;
*314:*  	my $dbh;
*315:*  	return sub {
*316:*  	unless ($dbh && $dbh->FETCH('Active') && $dbh->ping) {
*317:*  	$dbh = DBI->connect_cached(@connection);
*318:*  	}
*319:*  	return $dbh;
*320:*  	};
*...*  	

*code stack:*  	C:/apacheperl/Perl/site/lib/Ima/DBI.pm:316
C:/apacheperl/Perl/site/lib/Ima/DBI.pm:386
C:/apacheperl/Perl/site/lib/Class/DBI.pm:1093
C:/apacheperl/Perl/site/lib/Class/DBI.pm:1071
C:/apacheperl/Perl/site/lib/Class/DBI.pm:681
C:\home\www\ote.local\html\index.html:7




On the other hand, when I type the "use MyClass::DBI;" statement inside 
the perl script that produces a webpage, that seems to work fine.

What is happening? If I follow the second way,, will I get Class::DBI 
loaded 50 times (for the 50 active threads of Apache)? Would that be too 
much for a server with 512MB RAM?

Do you have any other suggestions you could mention to me?

Thanks,
 - Karjala
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20060320/0214e069/attachment.htm


More information about the ClassDBI mailing list