本文整理了Java中com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelCommit()
方法的一些代码示例,展示了XAResourceRecord.topLevelCommit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceRecord.topLevelCommit()
方法的具体详情如下:
包路径:com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord
类名称:XAResourceRecord
方法名:topLevelCommit
暂无
代码示例来源:origin: org.jboss.narayana.jta/jta
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: org.jboss.jbossts/jbossjta
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: jbosstm/narayana
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: jbosstm/narayana
protected int recover()
{
if (jtaLogger.logger.isTraceEnabled()) {
jtaLogger.logger.trace("XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: jboss.jbossts/jbossjts
protected int recover()
{
if (jtaLogger.logger.isDebugEnabled())
{
jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
VisibilityLevel.VIS_PROTECTED,
com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
"XAResourceRecord.recover");
}
if (_committed)
{
/*
* A previous commit attempt failed, but we know the intention
* was to commit. So let's try again.
*/
if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
return XARecoveryResource.RECOVERED_OK;
else
return XARecoveryResource.FAILED_TO_RECOVER;
}
else
return XARecoveryResource.WAITING_FOR_RECOVERY;
}
代码示例来源:origin: jbosstm/narayana
@Test
public void testValid2PC () throws Exception
{
TransactionImple tx = new TransactionImple(0);
DummyXA res = new DummyXA(false);
XAResourceRecord xares = new XAResourceRecord(tx, res, tx.getTxId(), null);
assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.FINISH_OK);
}
代码示例来源:origin: jbosstm/narayana
@Test
public void testCommitFailure () throws Exception
{
FailureXAResource fxa = new FailureXAResource(FailureXAResource.FailLocation.commit);
TransactionImple tx = new TransactionImple(0);
XAResourceRecord xares = new XAResourceRecord(tx, fxa, tx.getTxId(), null);
assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.HEURISTIC_MIXED);
assertTrue(xares.forgetHeuristic());
}
代码示例来源:origin: jbosstm/narayana
@Test
public void testInvalid () throws Exception
{
XAResourceRecord xares = new XAResourceRecord();
assertEquals(xares.getXid(), null);
assertEquals(xares.value(), null);
assertEquals(xares.topLevelOnePhaseCommit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_NOTOK);
assertEquals(xares.topLevelAbort(), TwoPhaseOutcome.FINISH_ERROR);
assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.FINISH_ERROR);
}
代码示例来源:origin: jbosstm/narayana
@Test
public void testReadonly () throws Exception
{
XAResourceRecord xares;
DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection();
Object[] params = new Object[1];
params[XAResourceRecord.XACONNECTION] = rc;
xares = new XAResourceRecord(new TransactionImple(0), new TestResource(true), new XidImple(new Uid()), params);
assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.NOT_PREPARED);
assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
}
内容来源于网络,如有侵权,请联系作者删除!