reorganizes code so validate with database access is not being called inside a transaction
Likely fixes the bug which causes the database connection to block: https://github.com/typeorm/typeorm/issues/6779