hi,
after developing with embperl for a few months i'm starting to
develop a new site and I'm going to try the custom-module + simple calls
from embperl pages, instead of developing inside embperl pages. Now all
the site is heavily dependant on DBI connections. I do use Apache::DBI
but I'd really like to be able to disable it at will. I guess I have 2
choices:
- put a 'connect' and 'disconnect' inside every embperl page. It's
the 'right way', explicitly connecting at the top of evey page and
disconnecting at the bottom. But I don't really want to, as it's not
really elegant nor practical. If I do forget one disconnect, Apache::DBI
will cover my tracks ... until the day I disable it and one of the
gazillion sites I'm hosting here starts leaking dbi-handles .. not a
nice thing to debug, really.
- put a 'connect' and 'disconnect' inside every subroutine. it's
much more 'Apache::DBI' dependant, as Apache::DBI will cache connections
and do a no-op upon disconnect. It's much easier. But performance will
be horrible if I drop Apache::DBI.
what strategies are you (with more experience than me) using? am I
messing myself up or explaining it all backwards?
martin
after developing with embperl for a few months i'm starting to
develop a new site and I'm going to try the custom-module + simple calls
from embperl pages, instead of developing inside embperl pages. Now all
the site is heavily dependant on DBI connections. I do use Apache::DBI
but I'd really like to be able to disable it at will. I guess I have 2
choices:
- put a 'connect' and 'disconnect' inside every embperl page. It's
the 'right way', explicitly connecting at the top of evey page and
disconnecting at the bottom. But I don't really want to, as it's not
really elegant nor practical. If I do forget one disconnect, Apache::DBI
will cover my tracks ... until the day I disable it and one of the
gazillion sites I'm hosting here starts leaking dbi-handles .. not a
nice thing to debug, really.
- put a 'connect' and 'disconnect' inside every subroutine. it's
much more 'Apache::DBI' dependant, as Apache::DBI will cache connections
and do a no-op upon disconnect. It's much easier. But performance will
be horrible if I drop Apache::DBI.
what strategies are you (with more experience than me) using? am I
messing myself up or explaining it all backwards?
martin