gemoroy has asked for the wisdom of the Perl Monks concerning the following question:
I am new to threads, so i faced such a problem:
I had written a class, witch works with dbm, but, when i am trying to call a sub, wich accesses db handle,
i'm getting such an error:Thread 1 terminated abnormally: DBD::DBM::db prepare failed: handle 2 is owned by thread 80100a000 not current thread 801051000 (handles can't be shared between threads and your driver may need a CLONE method added) at test_mod.pm line 55 line 55 is: $sql = $dbh->prepare($query) || die($dbh->errstr);Please could you explain why it is owned by other thread, when i am calling it from with only thread i have created, and what is CLONE method?
Or a different class method by default executed by it's own thread or smth like that?
Thanks a lot in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Threads and handle sharing
by BrowserUk (Patriarch) on Jun 27, 2009 at 02:47 UTC |