Searched refs:entityManager (Results 1 – 2 of 2) sorted by relevance
39 private final ThreadLocal<EntityManager> entityManager = new ThreadLocal<>(); field in JpaPersistService57 EntityManager em = entityManager.get(); in get()68 return entityManager.get() != null; in isWorking()74 null == entityManager.get(), in begin()78 entityManager.set(emFactory.createEntityManager()); in begin()83 EntityManager em = entityManager.get(); in end()93 entityManager.remove(); in end()
40 private final EntityManager entityManager = mock(EntityManager.class); field in JpaPersistServiceTest46 when(factory.createEntityManager()).thenReturn(entityManager); in setUp()54 doThrow(SimulatedException.class).when(entityManager).close(); in test_givenErrorOnEntityManagerClose_whenEndIsCalled_thenEntityManagerIsRemoved()