EntityManagerFactoryRegistry.getNamedEntityManagerFactory is using the (not thread safe) Set, while another thread could be modifying the Set.
See Static analysis report on thread safety of Hibernate for more details.