Fixed the db pool not closing, started to implement repository processing.