You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2002/07/15 07:18:39 UTC

DBI & Threads

Hi,

for whatever it's worth, I just wanted to let you know that I have made a
lot of test with DBI & DBD::Oracle & DBD::ODBC when using threads und
mod_perl 2. The result is, that the current DBI (1.28) seems to work as long
as DBI comes into play _after_ the Perl interpreter have been cloned,
otherwise it will crash.

Together with Tim Bunce I have created a patch that solve these problems and
Tim wanted to release it as DBI 1.29 (maybe beta) soon. Note that the DBD
drivers also need to be patched to be able to handle interpreter cloneing.
For most of the drivers this patch should be trivial. I already made it for
DBD::Oracle and DBD::ODBC.

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: DBI & Threads

Posted by Gerald Richter <ri...@ecos.de>.
>
> Was there supposed to be an attachment?
>

No, since I expect that Tim releases soon a new version of DBI. I just
wanted give a short infomation, since I think DBI is very important to the
success of mod_perl 2.

I case anybody likes to have the patch before Tim releases DBI, I attach it.

To get DBD::ODBC working, just add

    sub CLONE {
    $drh = undef ;
    }

to ODBC.pm. This CLONE sub must be added for all other DBD drivers as well
(assuming they use the same code as DBD::ODBC and DBD::Oracle for creating
$drh). For other drivers it is necessary to check if they use any globals in
their C code. If they do, the globals needs to made per thread. (That is
what the ora.patch does for DBD::Orcale). The ora.patch also contains some
experimetal code to share handles on the Orcale level between threads, but
it seems not to work quite well under mod_perl, while it does from the
command line.

NOTE: This patch only make sure DBI works correctly with multiple threads
and perl interpreter cloneing is handled correctly. There is currently no
way to share any DBI handles between threads. Shareing DBI handle, is what I
would like to implement, but after looking more closely to the DBI, I saw
that this is very very much work. Additonaly Tim suggested to first get DBI
cleanly running with threads, without the ability to share handles. That's
what the patch implements.

Gerald

P.S. I am off to holiday for the rest of the week, so I may not be able to
answer further questions. Looking forward to meet you all on the OSCON


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


Re: DBI & Threads

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 15 Jul 2002, Gerald Richter wrote:

> Hi,
>
> for whatever it's worth, I just wanted to let you know that I have made a
> lot of test with DBI & DBD::Oracle & DBD::ODBC when using threads und
> mod_perl 2. The result is, that the current DBI (1.28) seems to work as long
> as DBI comes into play _after_ the Perl interpreter have been cloned,
> otherwise it will crash.
>
> Together with Tim Bunce I have created a patch that solve these problems and
> Tim wanted to release it as DBI 1.29 (maybe beta) soon. Note that the DBD
> drivers also need to be patched to be able to handle interpreter cloneing.
> For most of the drivers this patch should be trivial. I already made it for
> DBD::Oracle and DBD::ODBC.

Was there supposed to be an attachment?

-- 
<!-- Matt -->
<:->Get a smart net</:->


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org