Fix message, remove len(gen) since gen is generator which is already exhausted
Save dburi as member data, to be used in subclasses
Replaced self.localcache.conn with db_connection call