Assert.fail(e.getMessage());
public void put(Object key, Object value, Date expired) { Map<String, Object> map = new HashMap<String, Object>(3); map.put(RESOURCE, value); if (expired != null) { map.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, expired.getTime()); } cache.put(createFqn(key), map); Transaction transaction = cache.getInvocationContext().getTransaction(); try { // TODO: to review if ((transaction != null) && (transaction.getStatus() == Status.STATUS_ACTIVE)) { transaction.commit(); } } catch (SystemException e) { LOGGER.error(e.getMessage(), e); } catch (SecurityException e) { LOGGER.error(e.getMessage(), e); } catch (IllegalStateException e) { LOGGER.error(e.getMessage(), e); } catch (RollbackException e) { LOGGER.error(e.getMessage(), e); } catch (HeuristicMixedException e) { LOGGER.error(e.getMessage(), e); } catch (HeuristicRollbackException e) { LOGGER.error(e.getMessage(), e); } }
txLogger.debug("A heuristic decision was made, some relevant updates have been committed while others have been rolled back: {0}", e.getMessage()); throw new ApplicationException(new RemoteException("A heuristic decision was made, some relevant updates have been committed while others have been rolled back", e));
txLogger.debug("A heuristic decision was made, some relevant updates have been committed while others have been rolled back: {0}", e.getMessage()); throw new ApplicationException(new RemoteException("A heuristic decision was made, some relevant updates have been committed while others have been rolled back", e));
txLogger.debug("A heuristic decision was made, some relevant updates have been committed while others have been rolled back: {0}", e.getMessage()); throw new ApplicationException(new RemoteException("A heuristic decision was made, some relevant updates have been committed while others have been rolled back", e));
public synchronized void recoveryCommit() throws CommitRequiredException, SystemException { TransactionXid xid = this.transactionContext.getXid(); try { this.recoverIfNecessary(); // Recover if transaction is recovered from tx-log. this.invokeParticipantCommit(); } catch (HeuristicMixedException ex) { logger.error("[{}] recover: branch={}, status= mixed, message= {}", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex.getMessage(), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } catch (HeuristicRollbackException ex) { logger.error("[{}] recover: branch={}, status= rolledback", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } }
public synchronized void recoveryCommit() throws CommitRequiredException, SystemException { TransactionXid xid = this.transactionContext.getXid(); try { this.recoverIfNecessary(); // Recover if transaction is recovered from tx-log. this.invokeParticipantCommit(); } catch (HeuristicMixedException ex) { logger.error("[{}] recover: branch={}, status= mixed, message= {}", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex.getMessage(), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } catch (HeuristicRollbackException ex) { logger.error("[{}] recover: branch={}, status= rolledback", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } }
public synchronized void recoveryCommit() throws CommitRequiredException, SystemException { TransactionXid xid = this.transactionContext.getXid(); try { this.recoverIfNecessary(); // Recover if transaction is recovered from tx-log. this.transactionContext.setRecoveredTimes(this.transactionContext.getRecoveredTimes() + 1); this.transactionContext.setCreatedTime(System.currentTimeMillis()); this.invokeParticipantCommit(false); } catch (HeuristicMixedException ex) { logger.error("{}> recover: branch={}, status= mixed, message= {}", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex.getMessage(), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } catch (HeuristicRollbackException ex) { logger.error("{}> recover: branch={}, status= rolledback", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex); SystemException sysEx = new SystemException(); sysEx.initCause(ex); throw sysEx; } }
fail("TM should have thrown HeuristicMixedException"); } catch (HeuristicMixedException ex) { assertEquals("transaction failed during commit of a Bitronix Transaction with GTRID [", ex.getMessage().substring(0, 71)); int idx = ex.getMessage().indexOf(']'); assertEquals("], status=UNKNOWN, 2 resource(s) enlisted (started ", ex.getMessage().substring(idx, idx + 51)); assertTrue("got message <" + ex.getMessage() + ">", ex.getMessage().endsWith("resource(s) [pds2] improperly unilaterally rolled back"));
fail("TM should have thrown HeuristicMixedException"); } catch (HeuristicMixedException ex) { assertEquals("transaction failed during commit of a Bitronix Transaction with GTRID [", ex.getMessage().substring(0, 71)); int idx = ex.getMessage().indexOf(']'); assertEquals("], status=UNKNOWN, 2 resource(s) enlisted (started ", ex.getMessage().substring(idx, idx + 51)); assertTrue("got message <" + ex.getMessage() + ">", ex.getMessage().endsWith("resource(s) [pds2] improperly unilaterally rolled back"));
throw new MisconfigurationException("kotowari.TX_UNEXPECTED_CONDITION", e.errorCode, e); } catch (HeuristicMixedException e) { throw new MisconfigurationException("kotowari.TX_HEURISTIC_MIXED", e.getMessage(), e); } catch (HeuristicRollbackException e) { throw new MisconfigurationException("kotowari.TX_HEURISTIC_ROLLBACK", e.getMessage(), e);
throw new MisconfigurationException("kotowari.TX_UNEXPECTED_CONDITION", e.errorCode, e); } catch (HeuristicMixedException e) { throw new MisconfigurationException("kotowari.TX_HEURISTIC_MIXED", e.getMessage(), e); } catch (HeuristicRollbackException e) { throw new MisconfigurationException("kotowari.TX_HEURISTIC_ROLLBACK", e.getMessage(), e);
/** * Commits transaction. */ public void commit() { try { TransactionImpl xa = getTransaction(); if (xa != null && xa.isRollbackOnly()) _ut.rollback(); else _ut.commit(); } catch (RuntimeException e) { throw e; } catch (RollbackException e) { throw new TransactionRolledbackLocalException(e.getMessage(), e); } catch (HeuristicMixedException e) { throw new TransactionRolledbackLocalException(e.getMessage(), e); } catch (HeuristicRollbackException e) { throw new TransactionRolledbackLocalException(e.getMessage(), e); } catch (Exception e) { throw new EJBException(e); } }
throw new RollbackException(e.getMessage()); } catch (HeuristicRollbackException e) { try