com.arjuna.ats.jta.TransactionManager.transactionManager()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(142)

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

TransactionManager.transactionManager介绍

[英]Retrieve the singleton transaction manager reference.
[中]检索单例事务管理器引用。

代码示例

代码示例来源:origin: kiegroup/jbpm

@After
public void tearDown() throws Exception {
  javax.transaction.TransactionManager txm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  assertTrue("There is still a transaction running!", txm.getTransaction() == null );
  
  cleanUp(context);
}

代码示例来源:origin: kiegroup/jbpm

@After
public void tearDown() throws Exception {
  javax.transaction.TransactionManager txm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  assertTrue("There is still a transaction running!", txm.getTransaction() == null );
  
  cleanUp(context);
  logService.dispose();
}

代码示例来源:origin: kiegroup/jbpm

Transaction tx = com.arjuna.ats.jta.TransactionManager.transactionManager()
    .getTransaction();
if (tx != null) {
  int testTxState = tx.getStatus();

代码示例来源:origin: jboss.jbossts/jbossjts

private TransactionImple getTransactionImple() throws IllegalStateException
  {
    javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
    TransactionImple transactionImple = null;
    try
    {
      transactionImple = (TransactionImple)tm.getTransaction();
    }
    catch (SystemException e)
    {
      throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
    }

    if(transactionImple == null)
    {
      throw new IllegalStateException();
    }

    return transactionImple;
  }
}

代码示例来源:origin: jboss.jbossts/jbossjts

private TransactionImple getTransactionImple() throws IllegalStateException
  {
    javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
    TransactionImple transactionImple = null;
    try
    {
      transactionImple = (TransactionImple)tm.getTransaction();
    }
    catch (SystemException e)
    {
      throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
    }

    if(transactionImple == null)
    {
      throw new IllegalStateException();
    }

    return transactionImple;
  }
}

代码示例来源:origin: org.jboss.jbossts/jbossjta

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: jboss.jbossts/jbossjts

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: org.jboss.narayana.jta/jdbc

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: jbosstm/narayana

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: jbosstm/narayana

protected final boolean transactionRunning() throws SQLException
{
  try
  {
    if (com.arjuna.ats.jta.TransactionManager.transactionManager()
        .getTransaction() != null)
    {
      return true;
    }
    else
    {
      return false;
    }
  }
  catch (Exception e)
  {
    SQLException sqlException = new SQLException(e.toString());
    sqlException.initCause(e);
    throw sqlException;
  }
}

代码示例来源:origin: org.jboss.jbossts/jbosstxbridge

/**
 * Return an OutboundBridge instance that maps the current Thread's JTA transaction context
 * to a WS-AT transaction context. Control of the latter is provided by the returned instance.
 *
 * @return as OutboundBridge corresponding to the calling Thread's current JTA transaction context.
 */
public static org.jboss.jbossts.txbridge.outbound.OutboundBridge getOutboundBridge()
{
  txbridgeLogger.logger.trace("OutboundBridgeManager.getOutboundBridge()");
  try
  {
    Transaction transaction = (Transaction)TransactionManager.transactionManager().getTransaction();
    Uid externalTxId = transaction.get_uid();
    if(!outboundBridgeMappings.containsKey(externalTxId)) {
      createMapping(transaction, externalTxId);
    }
    return outboundBridgeMappings.get(externalTxId);
  }
  catch(SystemException e)
  {
    txbridgeLogger.logger.error(e);
  }
  return null;
}

代码示例来源:origin: jboss.jbossts/jbossjts

public void setRollbackOnly()
{
  if (jtaLogger.logger.isDebugEnabled())
  {
    jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
        VisibilityLevel.VIS_PUBLIC,
        com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
        "TransactionSynchronizationRegistryImple.setRollbackOnly");
  }
  javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  try
  {
    Transaction transaction = tm.getTransaction();
    if(transaction == null)
    {
      throw new IllegalStateException();
    }
    tm.setRollbackOnly();
  }
  catch (SystemException e)
  {
    throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
  }
}

代码示例来源:origin: jbosstm/narayana

public void beforeCompletion ()
{
try
{
  javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  if (_currentStatus != INITIAL_STATUS)
  _currentStatus = ERROR_STATUS;
  else
  _currentStatus = BEFORE_COMPLETION_STATUS;
  System.out.println("beforeCompletion called from "+tm.getTransaction());
}
catch (Exception ex)
{
  ex.printStackTrace();
  _currentStatus = ERROR_STATUS;
}
}

代码示例来源:origin: jboss.jbossts/jbossjts

/**
 * @message com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception
 * [com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception]
 * The transaction implementation threw a SystemException
 */
public Object getTransactionKey()
{
  if (jtaLogger.logger.isDebugEnabled())
  {
    jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
        VisibilityLevel.VIS_PUBLIC,
        com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
        "TransactionSynchronizationRegistryImple.getTransactionKey");
  }
  javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  TransactionImple transactionImple = null;
  try
  {
    transactionImple = (TransactionImple)tm.getTransaction();
  }
  catch (SystemException e)
  {
    throw new RuntimeException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.systemexception"), e);
  }
  if (transactionImple == null) {
    return null;
  } else {
    return transactionImple.get_uid();
  }
}

代码示例来源:origin: jboss.jbossts/jbossjts

public void setRollbackOnly()
{
  if (jtaLogger.logger.isDebugEnabled())
  {
    jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
        VisibilityLevel.VIS_PUBLIC,
        com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
        "TransactionSynchronizationRegistryImple.setRollbackOnly");
  }
  javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  try
  {
    Transaction transaction = tm.getTransaction();
    if(transaction == null)
    {
      throw new IllegalStateException();
    }
    tm.setRollbackOnly();
  }
  catch (SystemException e)
  {
    throw new RuntimeException(jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.systemexception"), e);
  }
}

代码示例来源:origin: org.jboss.jbossts/jbossjta

.transactionManager();
javax.transaction.Transaction tx = tm.getTransaction();

代码示例来源:origin: jbosstm/narayana

public void afterCompletion (int status)
{
try
{
  javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  if (_currentStatus != BEFORE_COMPLETION_STATUS)
  _currentStatus = ERROR_STATUS;
  else
  _currentStatus = AFTER_COMPLETION_STATUS;
  System.out.println("afterCompletion called: "+JTAHelper.stringForm(status)+" from "+tm.getTransaction());
}
catch (Exception ex)
{
  ex.printStackTrace();
  _currentStatus = ERROR_STATUS;
}
}

代码示例来源:origin: jbosstm/narayana

@Test
  public void test() throws Exception
  {
    javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();

    tm.begin();

    javax.transaction.Transaction theTransaction = tm.getTransaction();

    tm.commit();

    tm.resume(theTransaction);
  }
}

相关文章

TransactionManager类方法