protected boolean calledInsideTransaction() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new ActivitiException("Could not determine the current status of the transaction manager: " + e.getMessage(), e); } }
/** * Get a handle for a specific peer for an XA operation. Identical to {@link #getPeerHandle(URI, SSLContext, AuthenticationConfiguration)} except * that an {@code XAException} is thrown in case of error instead of {@code SystemException}. * * @param location the peer location (not {@code null}) * @param sslContext the sticky SSL context to use (may be {@code null}) * @param authenticationConfiguration the sticky authentication configuration to use (may be {@code null}) * @return the handle, or {@code null} if this provider does not support this location */ default RemoteTransactionPeer getPeerHandleForXa(URI location, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) throws XAException { try { return getPeerHandle(location, sslContext, authenticationConfiguration); } catch (SystemException e) { final XAException xaException = new XAException(e.getMessage()); xaException.errorCode = XAException.XAER_RMFAIL; xaException.setStackTrace(e.getStackTrace()); throw xaException; } }
String.format( "FacetsJCAConnectionManagerImpl:: allocateConnection :system exception due to %s", ex.getMessage()), ex);
} catch (SystemException ex) { logger.debug("{}| recover: branch={}, message= {}", ByteUtils.byteArrayToString(xid.getGlobalTransactionId()), ByteUtils.byteArrayToString(xid.getBranchQualifier()), ex.getMessage(), ex); continue; } catch (RuntimeException ex) {
String.format( "JCAConnectionManagerImpl:: allocateConnection :system exception due to %s", ex.getMessage()), ex);
/** * Test case for: A) utx.begin was not invoked. B) Assert on invalid commit. */ @Test public void testInvalidCommit() { try { Assert.assertNotNull(utx); Assert.assertSame(KunderaJTAUserTransaction.class, utx.getClass()); // pass false, as transaction has not begun. assertOnCommit(utx, false); } catch (SystemException ex) { Assert.fail(ex.getMessage()); } }
/** * Method to test positive scenario: A) begin transaction. B) assertion on * invocation of commit method. */ @Test public void testInitializeViaLookup() { try { Assert.assertNotNull(utx); Assert.assertSame(KunderaJTAUserTransaction.class, utx.getClass()); utx.begin(); Assert.assertEquals(Status.STATUS_ACTIVE, utx.getStatus()); // pass true, as transaction has already begun. assertOnCommit(utx, true); } catch (NotSupportedException nsuex) { Assert.fail(nsuex.getMessage()); } catch (SystemException ex) { Assert.fail(ex.getMessage()); } }
Assert.fail(ex.getMessage());
@Override protected void cleanUpOnError() { if ( wrapInTransaction ) { try { batchContext.transactionManager.rollback(); } catch (SystemException e) { log.errorRollingBackTransaction( e.getMessage(), e ); } } }
protected boolean calledInsideTransaction() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new ActivitiException("Could not determine the current status of the transaction manager: " + e.getMessage(), e); } }
protected boolean calledInsideTransaction() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new ActivitiException("Could not determine the current status of the transaction manager: " + e.getMessage(), e); } }
@Override protected void cleanUpOnError() { if ( wrapInTransaction ) { try { batchContext.transactionManager.rollback(); } catch (SystemException e) { log.errorRollingBackTransaction( e.getMessage(), e ); } } }
public void delistAllResourceQuietly() { try { this.delistAllResource(); } catch (RollbackRequiredException rrex) { logger.warn(rrex.getMessage(), rrex); } catch (SystemException ex) { logger.warn(ex.getMessage(), ex); } catch (RuntimeException rex) { logger.warn(rex.getMessage(), rex); } }
@Override public Transaction getTransaction() { final TransactionManager manager = getTransactionManager(); if (manager != null) { try { return manager.getTransaction(); } catch (final SystemException e) { logger.error(e.getMessage(), e); } } return null; }
protected Transaction getTransaction() throws SystemException { try { return transactionManager.getTransaction(); } catch (final javax.transaction.SystemException e) { txLogger.error("The Transaction Manager has encountered an unexpected error condition while attempting to obtain current transaction: {0}", e.getMessage()); throw new SystemException(e); } }
@Override public Transaction getTransaction() { final TransactionManager manager = getTransactionManager(); if (manager != null) { try { return manager.getTransaction(); } catch (final SystemException e) { logger.error(e.getMessage(), e); } } return null; }
protected Transaction getTransaction() throws SystemException { try { return transactionManager.getTransaction(); } catch (final javax.transaction.SystemException e) { txLogger.error("The Transaction Manager has encountered an unexpected error condition while attempting to obtain current transaction: {0}", e.getMessage()); throw new SystemException(e); } }
public void stop() { if (LOG.isTraceEnabled()) { LOG.trace("InboundBridge.stop " + this); } try { TransactionManager.transactionManager().suspend(); } catch (SystemException e) { LOG.warn(e.getMessage(), e); throw new InboundBridgeException("Failed to stop the bridge.", e); } }
public static int getUserTransactionStatus(UserTransaction userTransaction) { int status = -1; try { status = userTransaction.getStatus(); } catch (SystemException e) { throw new SnakerException("无法获取事务状态:" + e.getMessage(), e); } return status; }
public static boolean isRollbackOnly() { try { return lookupJeeUserTransaction().getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw new SnakerException("无法获取用户事务的状态" + e.getMessage(), e); } }