public void unlock() { try { _broker.unlock(); } catch (RuntimeException re) { throw translate(re); } }
public void unlock() { try { _broker.unlock(); } catch (RuntimeException re) { throw translate(re); } }
public void unlock() { try { _broker.unlock(); } catch (RuntimeException re) { throw translate(re); } }
public void unlock() { try { _broker.unlock(); } catch (RuntimeException re) { throw translate(re); } }
public void unlock() { try { _broker.unlock(); } catch (RuntimeException re) { throw translate(re); } }
/** * Return a persistence manager facade to the given broker retaining * previously associated persistence context type. */ public static OpenJPAEntityManager toEntityManager(Broker broker) { if (broker == null) return null; broker.lock(); try { OpenJPAEntityManager em = (OpenJPAEntityManager) broker.getUserObject(EM_KEY); if (em == null) { EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) toEntityManagerFactory(broker.getBrokerFactory()); em = emf.newEntityManagerImpl(broker); broker.putUserObject(EM_KEY, em); } return em; } catch (Exception e) { throw PersistenceExceptions.toPersistenceException(e); } finally { broker.unlock(); } }
/** * Return a persistence manager facade to the given broker retaining * previously associated persistence context type. */ public static OpenJPAEntityManager toEntityManager(Broker broker) { if (broker == null) return null; broker.lock(); try { OpenJPAEntityManager em = (OpenJPAEntityManager) broker.getUserObject(EM_KEY); if (em == null) { EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) toEntityManagerFactory(broker.getBrokerFactory()); em = emf.newEntityManagerImpl(broker); broker.putUserObject(EM_KEY, em); } return em; } catch (Exception e) { throw PersistenceExceptions.toPersistenceException(e); } finally { broker.unlock(); } }
/** * Return a persistence manager facade to the given broker retaining * previously associated persistence context type. */ public static OpenJPAEntityManager toEntityManager(Broker broker) { if (broker == null) return null; broker.lock(); try { OpenJPAEntityManager em = (OpenJPAEntityManager) broker.getUserObject(EM_KEY); if (em == null) { EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) toEntityManagerFactory(broker.getBrokerFactory()); em = emf.newEntityManagerImpl(broker); broker.putUserObject(EM_KEY, em); } return em; } catch (Exception e) { throw PersistenceExceptions.toPersistenceException(e); } finally { broker.unlock(); } }
/** * Return a persistence manager facade to the given broker retaining * previously associated persistence context type. */ public static OpenJPAEntityManager toEntityManager(Broker broker) { if (broker == null) return null; broker.lock(); try { OpenJPAEntityManager em = (OpenJPAEntityManager) broker.getUserObject(EM_KEY); if (em == null) { EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) toEntityManagerFactory(broker.getBrokerFactory()); em = emf.newEntityManagerImpl(broker); broker.putUserObject(EM_KEY, em); } return em; } catch (Exception e) { throw PersistenceExceptions.toPersistenceException(e); } finally { broker.unlock(); } }
/** * Return a persistence manager facade to the given broker retaining * previously associated persistence context type. */ public static OpenJPAEntityManager toEntityManager(Broker broker) { if (broker == null) return null; broker.lock(); try { OpenJPAEntityManager em = (OpenJPAEntityManager) broker.getUserObject(EM_KEY); if (em == null) { EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) toEntityManagerFactory(broker.getBrokerFactory()); em = emf.newEntityManagerImpl(broker); broker.putUserObject(EM_KEY, em); } return em; } catch (Exception e) { throw PersistenceExceptions.toPersistenceException(e); } finally { broker.unlock(); } }