await connection.transaction(async manager => {
// in transactions you MUST use manager instance provided by a transaction,
// you cannot use global managers, repositories or custom repositories
// because this manager is exclusive and transactional
// and if let's say we would do custom repository as a service
// it has a "manager" property which should be unique instance of EntityManager
// but there is no global EntityManager instance and cannot be
// thats why custom managers are specific to each EntityManager and cannot be services.
// this also opens opportunity to use custom repositories in transactions without any issues:
const userRepository = manager.getCustomRepository(UserRepository); // DONT USE GLOBAL getCustomRepository here!
await userRepository.createAndSave("Timber", "Saw");
const timber = await userRepository.findByName("Timber", "Saw");