On Tue, Mar 04, 2003 at 02:31:37PM -0800, Dean Arnold wrote:
> While trying to test some multiprocessing on Win2K (ActiveState 633), I ran
> into
> an issue I'm hoping you can shed some light on. If I open a $dbh before
> forking
> off some kids that also open some $dbh's, I get the following error in the
> kids:
> 
> "DBD::Teradata::dr connect failed: handle 1 is owned by thread 1abf360 not
> current thread 3adf034 (ha
> ndles can't be shared between threads and your driver may need a CLONE
> method added) at D:/Perl/site
> /lib/DBI.pm line 513."
> 
> However, if I enable PurePerl, everything works fine. My assumption is that
> I need a
> CLONE { } of some sort within DBD::Teradata::dr, correct ? And this is all
> due
> to Win32's pseudo-fork, yes ? Are there any working examples of pure perl
> DBD CLONE { }
> I can cheat from ? I'm not entirely certain what I need to do within
> it...and I assume
> adding it now will be a head start on whatever is needed for 5.8 ?

Add
        sub CLONE {
                undef $drh;
        }

to the DBI::Teradata package, such that when an interpreter is cloned
the new one doesn't have the driver handle cached.

Tim.

Reply via email to