Code example for EntityManagerHolder

0
		} 
		else { 
			logger.debug("Opening JPA EntityManager in OpenEntityManagerInViewInterceptor"); 
			try { 
				EntityManager em = createEntityManager(); 
				EntityManagerHolder emHolder = new EntityManagerHolder(em); 
				TransactionSynchronizationManager.bindResource(getEntityManagerFactory(), emHolder); 
 
				AsyncRequestInterceptor interceptor = new AsyncRequestInterceptor(getEntityManagerFactory(), emHolder); 
				asyncManager.registerCallableInterceptor(participateAttributeName, interceptor); 
				asyncManager.registerDeferredResultInterceptor(participateAttributeName, interceptor); 
			} 
			catch (PersistenceException ex) { 
				throw new DataAccessResourceFailureException("Could not create JPA EntityManager", ex); 
			} 
		} 
	} 
 
	@Override 
	public void postHandle(WebRequest request, ModelMap model) { 
Experience pair programming with AI  Get Codota for Java