Jonathan Vanasco wrote:
so i'm currently using a cleanup handler which checks my DB
class to see if the current instantiation of the DB writer handle is in
a transaction. that works fine, but at the risk of screaming 'too much
optimization', if there's some internal var that i can access in the
cleanup that i can check to see if this check / reset is necessary or
not (ie, if there was a request death / error ), that would make me
happy, as its probably better than my transaction checking attempt.
That's already more optimization than I would do. I just roll back at
the end of every request. If there's nothing to roll back, it shouldn't
take long. However, if you catch your execptions, you'll know when
you've had one, and can roll back then. See below.
b - print some sort of other page
ideally:
in development - print whatever line that was getting sent
to errorlog from that
is this possible? if so, how? i can't find anything on
it.
You want to wrap your code in an eval block, catch the exceptions, and
print a stack trace (or just log the stack trace if you're in
production). You can use Carp for this, or Devel::StackTrace. There
are some docs on exception handling:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Exception_Handling_for_mod_perl
- Perrin