With JPA/Hibernate (mainly with Sprng Data JPA packages), the @EntiityManager is by default at the transaction scope, and if the transaction has multiple threads, then it is at the
thread scope. The scope can be expanded with some EM options. Google the use of EM, EM Factory, etc.
So createCriteria (CriteriaBuilder, CriteriaQuery, Root) should work. I think you mainly need to set your persistence.xml, PersistenceContext, EM Factory (should be a singleton) and EM (should be per transaction/thread) correctly. You don't want to set the transaction boundaries manually.