According to the subclassing posts that are out there, one of the things that you're supposed to do when subclassing DBI is to call __PACKAGE__->init_rootclass(). That works fine.
However, when you use Apache::DBI, Apache::DBI will be used to make the connection, but an Apache::DBI::db connection won't be returned to you; a connection from your class will. If the init_rootclass() is removed from the subclass, all works as expected, but of course, you lose any adjustments you may have made withing subclass::db and subclass::st.
Does anyone know of a workaround to this? It seems a shame to lose the persistent functionality of Apache::DBI if you want to use subclassed DBI::db and ::st objects. Conversely, it seems stupid to have to reinvent the Apache::DBI wheel when you have subclasses.
From what I've read in Apache::DBI's code, I suspect that a partial rewrite of Apache::DBI would be needed to support subclassed DBI objects, but I wanted to hear at least *some* opinions on the matter, first.
In reply to Apache::DBI and DBI subclasses by Hrunting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |