Re: Error: handles can't be shared between threads

2005-05-20 Thread Perrin Harkins
On Friday 20 May 2005 4:27 pm, Octavian Rasnita wrote: > In all the modules I have put something like: > > package Site::Module1; > > use strict; > use Site::MySQL (); #The module that connects to MySQL > my $dbh = Site::MySQL::dbh(); You are creating a closure when you use that $dbh in your subs.

Re: Error: handles can't be shared between threads

2005-05-20 Thread Octavian Rasnita
Hi, From: "Perrin Harkins" <[EMAIL PROTECTED]> > > I have put the following lines in a startup.pl file which is included for > > all virtualhosts (but I have a single virtual host): > > > > use Apache::DBI (); > > Apache::DBI->connect_on_init('DBI:mysql:database=test', 'root', undef, > > {PrintErr

Re: Error: handles can't be shared between threads

2005-05-19 Thread Perrin Harkins
On Fri, 2005-05-20 at 04:32 +0300, Octavian Rasnita wrote: > I have put the following lines in a startup.pl file which is included for > all virtualhosts (but I have a single virtual host): > > use Apache::DBI (); > Apache::DBI->connect_on_init('DBI:mysql:database=test', 'root', undef, > {PrintErr

Re: Error: handles can't be shared between threads

2005-05-19 Thread Octavian Rasnita
From: "Perrin Harkins" <[EMAIL PROTECTED]> > On Thursday 19 May 2005 1:47 pm, Octavian Rasnita wrote: > > [Thu May 19 20:36:01 2005] [error] DBD::mysql::db prepare failed: handle 2 > > is owned by thread 225321c not current thread 17cde94 (handles can't be > > shared between threads and your drive

Re: Error: handles can't be shared between threads

2005-05-19 Thread Perrin Harkins
On Thursday 19 May 2005 1:47 pm, Octavian Rasnita wrote: > [Thu May 19 20:36:01 2005] [error] DBD::mysql::db prepare failed: handle 2 > is owned by thread 225321c not current thread 17cde94 (handles can't be > shared between threads and your driver may need a CLONE method added) at > e:/web/presa3/

Error: handles can't be shared between threads

2005-05-19 Thread Octavian Rasnita
Hi, I am using mod_perl 2.0.0 under Windows 2000, with perl 5.8.6, Apache 2.0.54, and Apache::DBI version 0.96. I want to create a module that uses DBI.pm for connecting to the MySQL database, then using that module in all other modules that might need a connection. Here is the module I have tr