Add entity switch to UnitOfWork#commit()