com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelCommit()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(175)

本文整理了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

XAResourceRecord.topLevelCommit介绍

暂无

代码示例

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isTraceEnabled()) {
  4. jtaLogger.logger.trace("XAResourceRecord.recover");
  5. }
  6. if (_committed)
  7. {
  8. /*
  9. * A previous commit attempt failed, but we know the intention
  10. * was to commit. So let's try again.
  11. */
  12. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  13. return XARecoveryResource.RECOVERED_OK;
  14. else
  15. return XARecoveryResource.FAILED_TO_RECOVER;
  16. }
  17. else
  18. return XARecoveryResource.WAITING_FOR_RECOVERY;
  19. }

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

  1. protected int recover()
  2. {
  3. if (jtaLogger.logger.isDebugEnabled())
  4. {
  5. jtaLogger.logger.debug(DebugLevel.FUNCTIONS,
  6. VisibilityLevel.VIS_PROTECTED,
  7. com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA,
  8. "XAResourceRecord.recover");
  9. }
  10. if (_committed)
  11. {
  12. /*
  13. * A previous commit attempt failed, but we know the intention
  14. * was to commit. So let's try again.
  15. */
  16. if (topLevelCommit() == TwoPhaseOutcome.FINISH_OK)
  17. return XARecoveryResource.RECOVERED_OK;
  18. else
  19. return XARecoveryResource.FAILED_TO_RECOVER;
  20. }
  21. else
  22. return XARecoveryResource.WAITING_FOR_RECOVERY;
  23. }

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

  1. @Test
  2. public void testValid2PC () throws Exception
  3. {
  4. TransactionImple tx = new TransactionImple(0);
  5. DummyXA res = new DummyXA(false);
  6. XAResourceRecord xares = new XAResourceRecord(tx, res, tx.getTxId(), null);
  7. assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
  8. assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.FINISH_OK);
  9. }

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

  1. @Test
  2. public void testCommitFailure () throws Exception
  3. {
  4. FailureXAResource fxa = new FailureXAResource(FailureXAResource.FailLocation.commit);
  5. TransactionImple tx = new TransactionImple(0);
  6. XAResourceRecord xares = new XAResourceRecord(tx, fxa, tx.getTxId(), null);
  7. assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
  8. assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.HEURISTIC_MIXED);
  9. assertTrue(xares.forgetHeuristic());
  10. }

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

  1. @Test
  2. public void testInvalid () throws Exception
  3. {
  4. XAResourceRecord xares = new XAResourceRecord();
  5. assertEquals(xares.getXid(), null);
  6. assertEquals(xares.value(), null);
  7. assertEquals(xares.topLevelOnePhaseCommit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
  8. assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_NOTOK);
  9. assertEquals(xares.topLevelAbort(), TwoPhaseOutcome.FINISH_ERROR);
  10. assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.FINISH_ERROR);
  11. }

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

  1. @Test
  2. public void testReadonly () throws Exception
  3. {
  4. XAResourceRecord xares;
  5. DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection();
  6. Object[] params = new Object[1];
  7. params[XAResourceRecord.XACONNECTION] = rc;
  8. xares = new XAResourceRecord(new TransactionImple(0), new TestResource(true), new XidImple(new Uid()), params);
  9. assertEquals(xares.topLevelCommit(), TwoPhaseOutcome.NOT_PREPARED);
  10. assertEquals(xares.topLevelPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
  11. }

相关文章