}
boolean throwAway = false;
if (error instanceof StandardException) {
StandardException se = (StandardException) error;
if (abortAll) {
// any error aborts an internal/nested xact and its transaction
if (se.getSeverity() < ExceptionSeverity.TRANSACTION_SEVERITY)
{
throw StandardException.newException(
SQLState.XACT_INTERNAL_TRANSACTION_EXCEPTION, error);
}
throwAway = true;
} else {
// If the severity is lower than a transaction error then do nothing.
if (se.getSeverity() < ExceptionSeverity.TRANSACTION_SEVERITY)
{
return;
}
// If the session is going to disappear then we want to close this
// transaction, not just abort it.
if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY)
throwAway = true;
}
} else {
// some java* error, throw away the transaction.
throwAway = true;
}
try {
if (xact != null) {
// abort the transaction
xact.abort();
}
} catch (StandardException se) {
// if we get an error during abort then shut the system down
throwAway = true;
// if the system was being shut down anyway, do nothing
if ((se.getSeverity() <= ExceptionSeverity.SESSION_SEVERITY) &&
(se.getSeverity() >= ((StandardException) error).getSeverity())) {
throw factory.markCorrupt(
StandardException.newException(
SQLState.XACT_ABORT_EXCEPTION, se));
}