RE: Does DBD::Pg work w/mp2?

2003-06-22 Thread Marc M. Adkins
 Is anyone using PostgreSQL via DBD::Pg in a threaded environment?
 
 It appears as though the DBD::Pg driver hasn't been made thread-safe yet.
 However it's possible that I'm misusing it somehow, doing something in my
 startup.pl that I shouldn't, whatever.  So I'm asking if anyone else is
 using DBD::Pg successfully w/mp2 at the current time???

From the DBD::Pg mailing list:

-

The version in CVS should work with threading, but the version on CPAN 
does not yet. You can download a cvs copy:

http://gborg.postgresql.org/project/dbdpg/projdisplay.php

or just add these three lines to Pg.pm and recompile:

diff -c -r1.37 Pg.pm
*** Pg.pm   10 Jun 2003 19:14:53 - 
 1.37
--- Pg.pm   22 Jun 2003 21:22:31 -
***
*** 38,43 
--- 38,47 
  $errstr = ; # holds error string for DBI::errstr
  $drh = undef; # holds driver handle once initialized
  
+   sub CLONE {
+   $drh = undef ;
+   }
+ 
  sub driver{
return $drh if $drh;
my($class, $attr) = @_;

-

I've tried it and it seems to work just fine.

mma



Does DBD::Pg work w/mp2?

2003-06-20 Thread Marc M. Adkins
Is anyone using PostgreSQL via DBD::Pg in a threaded environment?

I'm getting:

[Fri Jun 20 11:47:57 2003] [error] [client 127.0.0.1]
  DBD::Pg::dr default_user failed: handle 1
  is owned by thread 126e2e4
  not current thread 11df014
  (handles can't be shared between threads and
   your driver may need a CLONE method added)

with DBD::Pg 1.22 (W2K, Apache 2.0.46, Perl 5.8, mod_perl 1.99.10-dev).

It appears as though the DBD::Pg driver hasn't been made thread-safe yet.
However it's possible that I'm misusing it somehow, doing something in my
startup.pl that I shouldn't, whatever.  So I'm asking if anyone else is
using DBD::Pg successfully w/mp2 at the current time???

In the meantime the DBD::PgPP driver works OK, but of course it probably
won't perform as well.

mma