Package org.springframework.transaction

# Class TransactionSystemException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.transaction.TransactionException
org.springframework.transaction.TransactionSystemException

All Implemented Interfaces:
  `Serializable`

public class TransactionSystemException extends TransactionException
Exception thrown when a general transaction system error is encountered, like on commit or rollback.

Since:
  24.03.2003
Author:
  Juergen Hoeller
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`TransactionSystemException(String msg)`
Constructor for TransactionSystemException.
`TransactionSystemException(String msg, Throwable cause)`
Constructor for TransactionSystemException.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`contains(Class<?> exType)`
`final Throwable`
`getApplicationException()`
Return the application exception that was thrown before this transaction exception, if any.
`Throwable`
`getOriginalException()`
Return the exception that was the first to be thrown within the failed transaction: i.e.
`void`
`initApplicationException(Throwable ex)`
Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.

### Methods inherited from class org.springframework.core.NestedRuntimeException

`getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### TransactionSystemException

public TransactionSystemException(String msg)
Constructor for TransactionSystemException.

Parameters:
  `msg` - the detail message

### TransactionSystemException

public TransactionSystemException(String msg, Throwable cause)
Constructor for TransactionSystemException.

Parameters:
  `msg` - the detail message
  `cause` - the root cause from the transaction API in use

## Method Details

### initApplicationException

public void initApplicationException(Throwable ex)
Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.

Parameters:
  `ex` - the application exception
Throws:
  `IllegalStateException` - if this TransactionSystemException already holds an application exception

### getApplicationException

@Nullable public final Throwable getApplicationException()
Return the application exception that was thrown before this transaction exception, if any.

Returns:
  the application exception, or `null` if none set

### getOriginalException

@Nullable public Throwable getOriginalException()
Return the exception that was the first to be thrown within the failed transaction: i.e. the application exception, if any, or the TransactionSystemException's own cause.

Returns:
  the original exception, or `null` if there was none

### contains

public boolean contains(@Nullable Class<?> exType)

Overrides:
  `contains` in class `org.springframework.core.NestedRuntimeException`