in reply to Re: share MySQL resources among threads
in thread share MySQL resources among threads

I just tried option 2, because I get the impression that I only have to change the connect statement, right ?

Anyway, it worked. However when the server stops I get the following:
(in cleanup) Can't call method "FETCH" on an undefined value a +t /usr/lib/perl5/site_perl/5.8.8/DBIx/Threaded.pm line 1727 during gl +obal destruction. (in cleanup) Can't call method "FETCH" on an undefined value a +t /usr/lib/perl5/site_perl/5.8.8/DBIx/Threaded.pm line 1727 during gl +obal destruction. (in cleanup) Can't call method "FETCH" on an undefined value a +t /usr/lib/perl5/site_perl/5.8.8/DBIx/Threaded.pm line 1727 during gl +obal destruction. (in cleanup) Can't call method "FETCH" on an undefined value a +t /usr/lib/perl5/site_perl/5.8.8/DBIx/Threaded.pm line 1727 during gl +obal destruction. (in cleanup) Can't call method "FETCH" on an undefined value a +t /usr/lib/perl5/site_perl/5.8.8/DBIx/Threaded.pm line 1727 during gl +obal destruction. A thread exited while 4 threads were running.
Any suggestions what might be the reason of this message ?

Replies are listed 'Best First'.
Re^3: share MySQL resources among threads
by renodino (Curate) on Sep 06, 2007 at 20:19 UTC
    Looks like another instance where the object and tied hash get DESTROYed in an odd order. Note that the DESTROY() for DBIx::Threaded::db wraps the same code in an eval{} to make it go away, so I'd suggest trying the same. Just edit your copy of Threaded.pm at line 1727 to
    eval { $obj->{_inner}--; $obj->_send_simplex('DESTROY') unless $obj->{_inner}; };
    and that should silence the errors.

    Perl Contrarian & SQL fanboy
Re^3: share MySQL resources among threads
by BrowserUk (Patriarch) on Sep 06, 2007 at 11:43 UTC