org.apache.openjpa.kernel.Broker.lock()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.openjpa.kernel.Broker.lock()方法的一些代码示例,展示了Broker.lock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.lock()方法的具体详情如下:
包路径:org.apache.openjpa.kernel.Broker
类名称:Broker
方法名:lock

Broker.lock介绍

[英]Ensure that the given instance is locked at the given lock level.
[中]确保给定实例在给定的锁定级别锁定。

代码示例

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

public void lock(Object obj, OpCallbacks call) {
  try {
    _broker.lock(obj, call);
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

public void lock() {
  try {
    _broker.lock();
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

public void lock() {
  try {
    _broker.lock();
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-kernel

public void lock() {
  try {
    _broker.lock();
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

public void lock(Object obj, OpCallbacks call) {
  try {
    _broker.lock(obj, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-kernel

public void lock(Object obj, int level, int timeout, OpCallbacks call) {
  try {
    _broker.lock(obj, level, timeout, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

public void lock() {
  try {
    _broker.lock();
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

public void lock(Object obj, OpCallbacks call) {
  try {
    _broker.lock(obj, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

public void lock(Object obj, int level, int timeout, OpCallbacks call) {
  try {
    _broker.lock(obj, level, timeout, call);
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

public void lock(Object obj, int level, int timeout, OpCallbacks call) {
  try {
    _broker.lock(obj, level, timeout, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

public void lock(Object obj, int level, int timeout, OpCallbacks call) {
  try {
    _broker.lock(obj, level, timeout, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-kernel

public void lock(Object obj, OpCallbacks call) {
  try {
    _broker.lock(obj, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

public void lock(Object obj, int level, int timeout, OpCallbacks call) {
  try {
    _broker.lock(obj, level, timeout, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

public void lock(Object obj, OpCallbacks call) {
  try {
    _broker.lock(obj, call);
  } catch (RuntimeException re) {
    throw translate(re, obj);
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

public void lock() {
  try {
    _broker.lock();
  } catch (RuntimeException re) {
    throw translate(re);
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * 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();
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * 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();
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * 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();
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * 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();
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * 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();
  }
}

相关文章

微信公众号

最新文章

更多

Broker类方法