Inject connection in repair class, fix postgres

Inject the DB connection in the repair class and use it outside to
manually rollback in the unit test to fix postgres unit test