Top Description Fields Constructors Methods
org.springframework.transaction

public Class TransactionSystemException

extends TransactionException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.lang.Nullable, org.springframework.util.Assert

Exception thrown when a general transaction system error is encountered, like on commit or rollback.
Author
Juergen Hoeller
Since
24.03.2003

Field Summary

Modifier and TypeField and Description
private Throwable

Constructor Summary

AccessConstructor and Description
public
TransactionSystemException(String
the detail message
msg
)

Constructor for TransactionSystemException.

public
TransactionSystemException(String
the detail message
msg
,
Throwable
the root cause from the transaction API in use
cause
)

Constructor for TransactionSystemException.

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(Class<?>
the exception type to look for
exType
)

Overrides org.springframework.core.NestedRuntimeException.contains.

Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

public final Throwable

Returns:

the application exception, or null if none set
getApplicationException
()

Return the application exception that was thrown before this transaction exception, if any.

public Throwable

Returns:

the original exception, or null if there was none
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.

public void
initApplicationException(Throwable
the application exception
ex
)

Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.

Field Detail

applicationExceptionback to summary
private Throwable applicationException
Annotations
@Nullable

Constructor Detail

TransactionSystemExceptionback to summary
public TransactionSystemException(String msg)

Constructor for TransactionSystemException.

Parameters
msg:String

the detail message

TransactionSystemExceptionback to summary
public TransactionSystemException(String msg, Throwable cause)

Constructor for TransactionSystemException.

Parameters
msg:String

the detail message

cause:Throwable

the root cause from the transaction API in use

Method Detail

containsback to summary
public boolean contains(Class<?> exType)

Overrides org.springframework.core.NestedRuntimeException.contains.

Doc from org.springframework.core.NestedRuntimeException.contains.

Check whether this exception contains an exception of the given type: either it is of the given class itself or it contains a nested cause of the given type.

Parameters
exType:Class<?>

the exception type to look for

Returns:boolean

whether there is a nested exception of the specified type

Annotations
@Override
getApplicationExceptionback to summary
public final Throwable getApplicationException()

Return the application exception that was thrown before this transaction exception, if any.

Returns:Throwable

the application exception, or null if none set

Annotations
@Nullable
getOriginalExceptionback to summary
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:Throwable

the original exception, or null if there was none

Annotations
@Nullable
initApplicationExceptionback to summary
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:Throwable

the application exception

Exceptions
IllegalStateException:
if this TransactionSystemException already holds an application exception