类 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
- 所有已实现的接口:
Serializable
public class TransactionSystemException extends TransactionException
Exception thrown when a general transaction system error is encountered, like on commit or rollback.- 从以下版本开始:
- 24.03.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 TransactionSystemException(String msg)
Constructor for TransactionSystemException.TransactionSystemException(String msg, Throwable cause)
Constructor for TransactionSystemException.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
contains(Class<?> exType)
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.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. the application exception, if any, or the TransactionSystemException's own cause.void
initApplicationException(Throwable ex)
Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.从类继承的方法 org.springframework.core.NestedRuntimeException
getMessage, getMostSpecificCause, getRootCause
构造器详细资料
TransactionSystemException
public TransactionSystemException(String msg)
Constructor for TransactionSystemException.- 参数:
msg
- the detail message
TransactionSystemException
public TransactionSystemException(String msg, Throwable cause)
Constructor for TransactionSystemException.- 参数:
msg
- the detail messagecause
- the root cause from the transaction API in use
方法详细资料
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.- 参数:
ex
- the application exception- 抛出:
IllegalStateException
- if this TransactionSystemException already holds an application exception
getApplicationException
public final Throwable getApplicationException()
Return the application exception that was thrown before this transaction exception, if any.- 返回:
- the application exception, or
null
if none set
getOriginalException
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.- 返回:
- the original exception, or
null
if there was none
contains
public boolean contains(Class<?> exType)
从类复制的说明:NestedRuntimeException
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.- 覆盖:
contains
在类中NestedRuntimeException
- 参数:
exType
- the exception type to look for- 返回:
- whether there is a nested exception of the specified type