On Feb 3, 2005, at 3:30 PM, Tim Bunce wrote:

Any thoughts on this, then?

Same as before - not very keen.

It'd be faster than a callback, though. ;-)

Yes. The current attribute setting post-connect would be done
pre-connect so if the cached handle is okay it's returned unaltered.

Gotcha. I like it!

Should be pretty straight-forward. Are there other events for which
you'd like to add callbacks? OnPrepare, perhaps? OnExecute? OnFetch?

Yes, but let's just start with the connect ones for now.

Okay. It seems pretty simple. Your initial implementation is quite straight-forward:

        if ($dbh and my $oc = $dbh->{OnConnect}) {
            $oc->($dbh, $dsn, $user, $pass, $attr) if ref $oc eq 'CODE';
        }

The only issue I can think of is that some callbacks will be called much more than others. Do you think that it's a performance issue to be checking for a callback every time the method is called when most people won't use it at all? I don't think I see a way around that, though...

Regards,

David

--
David Wheeler
President, Kineticode, Inc.
http://www.kineticode.com/
Kineticode. Setting knowledge in motion.[sm]

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Reply via email to