i dont have a good answer for you, just an ugly hack to help you get by until you find the answer:
you can create a mutex with
flock right before the code you believe is suspect (
... which fetches a Class::DBI object and displays it ... ) and release the filelock after you're done with the suspect area.
-hth