On Sun, Apr 29, 2007 at 09:53:29AM -0700, Dean Arnold wrote:
> It doesn't appear in CPAN search, and the link from
> DBI's POD returns "not found". I found an old email
> pointing to Stas Beckman's personal website, but
> its no longer there either.

I've attached the latest copy I have from Stas, which I'm sure is the
latest as I know neither Stas nor I have done any work on it recently.

> FWIW: I'm trying to better understand how the "brain surgery" works

I'll happily answer any questions not answered by the take_imp_data() docs.

> with an eye toward (a) how to make it work w/ pure Perl DBDs, and

well, as a first step I've just done this:

--- lib/DBI/PurePerl.pm (revision 9465)
+++ lib/DBI/PurePerl.pm (working copy)
@@ -844,7 +844,16 @@
     warn "private_data @_";
 }
 sub take_imp_data {
-    undef;
+    my $dbh = shift;
+    # A reasonable default implementation. Typically a pure-perl driver would
+    # have their own take_imp_data method that would delete all but the
+    # essential items in the hash before einding with:
+    #      return $dbh->SUPER::take_imp_data();
+    # Of course it's useless if the driver doesn't also implement support for
+    # the dbi_imp_data attribute to the connect() method.
+    require Storable;
+    delete $dbh->{$_} for (keys %is_valid_attribute);
+    return Storable::freeze($dbh);
 }
 sub rows {
     return -1; # always returns -1 here, see DBD::_::st::rows below

All the really matters is that the driver's take_imp_data() method
produces a simple scalar value that the driver's dbi_imp_data attribute
can use to restore a working connection.

> (b) what (if anything) I might do to accommodate it
> in a threads::shared replacement I'm developing.

Could you give some more details?

Tim.

Attachment: DBI-Pool-0.03.tar.gz
Description: application/tar-gz

Reply via email to