Keep open a single connection to the database (is this the right way to do this?).
Whoops, was destroying the collection pointer too early.