javax.persistence.EntityManager.isJoinedToTransaction()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(186)

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

EntityManager.isJoinedToTransaction介绍

[英]Determine whether the entity manager is joined to the current transaction. Returns false if the entity manager is not joined to the current transaction or if no transaction is active
[中]确定实体管理器是否已加入当前事务。如果实体管理器未加入当前事务或没有活动事务,则返回false

代码示例

代码示例来源:origin: rapidoid/rapidoid

@Override
public boolean isJoinedToTransaction() {
  return em.isJoinedToTransaction();
}

代码示例来源:origin: rapidoid/rapidoid

@Override
public boolean isJoinedToTransaction() {
  return em().isJoinedToTransaction();
}

代码示例来源:origin: org.evolvis.bsi/kolab-ws

@Override
public boolean
isJoinedToTransaction()
{
  return delegate.isJoinedToTransaction();
}

代码示例来源:origin: kumuluz/kumuluzee

@Override
public boolean isJoinedToTransaction() {
  return em.isJoinedToTransaction();
}

代码示例来源:origin: com.phloc/phloc-db

public boolean isJoinedToTransaction ()
{
 return m_aEntityMgr.isJoinedToTransaction ();
}

代码示例来源:origin: EvoSuite/evosuite

@Override
public boolean isJoinedToTransaction() {
  return em.isJoinedToTransaction();
}

代码示例来源:origin: com.kumuluz.ee/kumuluzee-jpa-common

@Override
public boolean isJoinedToTransaction() {
  return em.isJoinedToTransaction();
}

代码示例来源:origin: org.wildfly/wildfly-jpa

@Override
public boolean isJoinedToTransaction() {
  return entityManager.isJoinedToTransaction();
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
public boolean isJoinedToTransaction() {
  return delegate.isJoinedToTransaction();
}

代码示例来源:origin: com.helger/ph-db-jpa

public boolean isJoinedToTransaction ()
{
 return m_aEntityMgr.isJoinedToTransaction ();
}

代码示例来源:origin: org.jboss.eap/wildfly-jpa

@Override
public boolean isJoinedToTransaction() {
  return entityManager.isJoinedToTransaction();
}

代码示例来源:origin: com.carecon.fabric3/fabric3-jpa-hibernate

public boolean isJoinedToTransaction() {
  initEntityManager();
  return em.isJoinedToTransaction();
}

代码示例来源:origin: net.oneandone/ejb-cdi-unit

@Override
public boolean isJoinedToTransaction() {
  return getEmbeddedEntityManager().isJoinedToTransaction();
}

代码示例来源:origin: kumuluz/kumuluzee

@Override
public boolean isJoinedToTransaction() {
  return getEntityManager().isJoinedToTransaction();
}

代码示例来源:origin: org.jboss.eap/wildfly-jpa

public boolean isJoinedToTransaction() {
  long start = 0;
  if (isTraceEnabled)
    start = System.currentTimeMillis();
  try {
    return getEntityManager().isJoinedToTransaction();
  } finally {
    if (isTraceEnabled) {
      long elapsed = System.currentTimeMillis() - start;
      ROOT_LOGGER.tracef("isJoinedToTransaction() took %dms", elapsed);
    }
  }
}

代码示例来源:origin: org.wildfly/wildfly-jpa

public boolean isJoinedToTransaction() {
  long start = 0;
  if (isTraceEnabled)
    start = System.currentTimeMillis();
  try {
    return getEntityManager().isJoinedToTransaction();
  } finally {
    if (isTraceEnabled) {
      long elapsed = System.currentTimeMillis() - start;
      ROOT_LOGGER.tracef("isJoinedToTransaction() took %dms", elapsed);
    }
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
  public boolean isJoinedToTransaction() {
    final Timer timer = Op.isJoinedToTransaction.start(this.timer, this);
    try {
      return synchronizationType == null /* JPA < 2.1 */ || getEntityManager().isJoinedToTransaction();
    } finally {
      timer.stop();
    }
  }
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
public void beginTransaction(EntityManager em) {
  AbstractSession session = JpaHelper.getEntityManagerFactory(em).getDatabaseSession();
  session.getExternalTransactionController().beginTransaction(session);
  // EMs obtained outside the transaction is now prevented from participating or flushing to the trans unless join is called. 
  if (!em.isJoinedToTransaction()) {
    em.joinTransaction();
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.dbws

@Override
public void beginTransaction(EntityManager em) {
  AbstractSession session = JpaHelper.getEntityManagerFactory(em).getDatabaseSession();
  session.getExternalTransactionController().beginTransaction(session);
  // EMs obtained outside the transaction is now prevented from participating or flushing to the trans unless join is called.
  if (!em.isJoinedToTransaction()) {
    em.joinTransaction();
  }
}

代码示例来源:origin: org.glassfish.main.common/container-common

@Override
public boolean isJoinedToTransaction() {
  try {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodStart(EntityManagerMethod.IS_JOINED_TO_TRANSACTION);
    }
    return _getDelegate().isJoinedToTransaction();
  } finally {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodEnd();
    }
  }
}

相关文章