| From | Sent On | Attachments |
|---|---|---|
| David Wheeler | Jan 31, 2005 10:28 pm | |
| Tim Bunce | Feb 1, 2005 2:43 am | |
| David Wheeler | Feb 1, 2005 9:16 am | |
| Tim Bunce | Feb 2, 2005 2:58 am | |
| David Wheeler | Feb 2, 2005 10:49 am | |
| David Wheeler | Feb 2, 2005 10:57 am | |
| Tim Bunce | Feb 3, 2005 7:44 am | |
| David Wheeler | Feb 3, 2005 8:40 am | |
| Tim Bunce | Feb 3, 2005 3:30 pm | |
| David Wheeler | Feb 3, 2005 3:48 pm | |
| Tim Bunce | Feb 4, 2005 2:07 am | |
| David Wheeler | Feb 4, 2005 10:38 am | |
| Sheikin Sergei | Feb 4, 2005 11:31 am | |
| Michael A Chase | Feb 4, 2005 12:22 pm | |
| David Wheeler | Feb 11, 2005 11:18 am | |
| Tim Bunce | Feb 12, 2005 10:11 am | |
| David Wheeler | Feb 12, 2005 4:35 pm | |
| Tim Bunce | Feb 13, 2005 2:44 pm | |
| David Wheeler | Feb 13, 2005 5:54 pm | |
| Tim Bunce | Feb 14, 2005 3:09 am | |
| David Wheeler | Feb 15, 2005 10:37 am | |
| Tim Bunce | Feb 15, 2005 2:21 pm | |
| David Wheeler | Feb 15, 2005 9:01 pm |
| Subject: | Re: AutoCommit and connect_cached() | |
|---|---|---|
| From: | David Wheeler (dav...@kineticode.com) | |
| Date: | Feb 3, 2005 3:48:49 pm | |
| List: | org.perl.dbi-dev | |
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]





