Tim Bunce wrote:

Okay.  I've appended the change I've made. Let me know if it's not clear
enough.

Thanks Dean.

Tim.

@@ -6574,6 +6633,13 @@
 If your subclass supplies a connected method, it should be part of the
 MySubDBI::db package.
+One more thing to note: you must let the DBI do the handle creation. If you
+want to override the connect() method in your *::dr class then it must still
+call SUPER::connect to get a $dbh to work with. Similarly, an overridden
+prepare() method in *::db must still call SUPER::prepare to get a $sth.
+If you try to create your own handles using bless() then you'll find the DBI
+will reject them with an "is not a DBI handle (has no magic)" error.
+
 Here's a brief example of a DBI subclass.  A more thorough example
 can be found in t/subclass.t in the DBI distribution.

Looks great. Should be sufficient reminder that I won't
stub my toe on it again.

- Dean

Reply via email to