Java Code Examples for javax.transaction.SystemException#getMessage()

The following examples show how to use javax.transaction.SystemException#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionImpl.java    From clearpool with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void commit() throws RollbackException, HeuristicMixedException,
    HeuristicRollbackException, SecurityException, SystemException {
  if (this.status == Status.STATUS_ROLLEDBACK) {
    throw new RollbackException("the transaction had been rolled back");
  }
  if (this.rollbackOnly) {
    this.rollback();
    return;
  }
  if (this.status != Status.STATUS_ACTIVE) {
    throw new IllegalStateException("the transaction is not active");
  }
  this.tryEndResource();
  boolean preparedSuccess = this.tryPrepared();
  if (preparedSuccess) {
    this.tryCommit();
    return;
  }
  try {
    this.tryRollback();
  } catch (SystemException e) {
    throw new HeuristicRollbackException(e.getMessage());
  }
  throw new HeuristicRollbackException("roll back all the transaction");
}
 
Example 2
Source File: JtaRetryInterceptor.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
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);
  }
}
 
Example 3
Source File: JtaRetryInterceptor.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
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);
  }
}
 
Example 4
Source File: JtaRetryInterceptor.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
protected boolean calledInsideTransaction() {
    try {
        return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION;
    } catch (SystemException e) {
        throw new FlowableException("Could not determine the current status of the transaction manager: " + e.getMessage(), e);
    }
}
 
Example 5
Source File: JtaRetryInterceptor.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example 6
Source File: NeverInterceptor.java    From openwebbeans-meecrowave with Apache License 2.0 5 votes vote down vote up
@Override
protected State start() {
    try {
        if (transactionManager.getTransaction() != null) {
            throw new TransactionalException("@Transactional(NEVER) but a transaction is running", new IllegalStateException());
        }
        return STATE;
    } catch (final SystemException e) {
        throw new TransactionalException(e.getMessage(), e);
    }
}
 
Example 7
Source File: SupportsInterceptor.java    From openwebbeans-meecrowave with Apache License 2.0 5 votes vote down vote up
@Override
protected State start() {
    final Transaction transaction;
    try {
        transaction = transactionManager.getTransaction();
    } catch (final SystemException e) {
        throw new TransactionalException(e.getMessage(), e);
    }
    return new State(transaction, transaction);
}
 
Example 8
Source File: MandatoryInterceptor.java    From openwebbeans-meecrowave with Apache License 2.0 5 votes vote down vote up
@Override
protected State start() {
    try {
        final Transaction transaction = transactionManager.getTransaction();
        return new State(transaction, transaction);
    } catch (final SystemException e) {
        throw new TransactionalException(e.getMessage(), e);
    }
}
 
Example 9
Source File: NotSupportedInterceptor.java    From openwebbeans-meecrowave with Apache License 2.0 5 votes vote down vote up
@Override
protected State start() {
    try {
        final Transaction tx = transactionManager.getTransaction();
        return new State(tx, null);
    } catch (final SystemException e) {
        throw new TransactionalException(e.getMessage(), e);
    }
}
 
Example 10
Source File: JtaTransactionHelper.java    From snakerflow with Apache License 2.0 5 votes vote down vote up
public static int getUserTransactionStatus(UserTransaction userTransaction) {
	int status = -1;
	try {
		status = userTransaction.getStatus();
	} catch (SystemException e) {
		throw new SnakerException("无法获取事务状态:" + e.getMessage(), e);
	}
	return status;
}
 
Example 11
Source File: JtaTransactionHelper.java    From snakerflow with Apache License 2.0 5 votes vote down vote up
public static boolean isRollbackOnly() {
	try {
		return lookupJeeUserTransaction().getStatus() == Status.STATUS_MARKED_ROLLBACK;
	} catch (SystemException e) {
		throw new SnakerException("无法获取用户事务的状态" + e.getMessage(), e);
	}
}
 
Example 12
Source File: GreeterImplWithTransaction.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
public void greetMeOneWay(String name) {
    ConfiguredBeanLocator locator = BusFactory.getDefaultBus().getExtension(ConfiguredBeanLocator.class);
    TransactionManager tm = locator.getBeansOfType(TransactionManager.class).iterator().next();
    try {
        Assert.assertNotNull("We should run inside a transaction", tm.getTransaction());
    } catch (SystemException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
    if (BAD_GUY.equals(name)) {
        throw new RuntimeException("Got a bad guy call for greetMe");
    }
}