Allow task thread to survive loss of database connection