Class TransactionSystemException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.micronaut.transaction.exceptions.TransactionException
-
- io.micronaut.transaction.exceptions.TransactionSystemException
-
- All Implemented Interfaces:
java.io.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(java.lang.String msg)Constructor for TransactionSystemException.TransactionSystemException(java.lang.String msg, java.lang.Throwable cause)Constructor for TransactionSystemException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetApplicationException()Return the application exception that was thrown before this transaction exception, if any.java.lang.ThrowablegetOriginalException()Return the exception that was the first to be thrown within the failed transaction: i.e.voidinitApplicationException(java.lang.Throwable ex)Set an application exception that was thrown before this transaction exception, preserving the original exception despite the overriding TransactionSystemException.
-
-
-
Constructor Detail
-
TransactionSystemException
public TransactionSystemException(java.lang.String msg)
Constructor for TransactionSystemException.- Parameters:
msg- the detail message
-
TransactionSystemException
public TransactionSystemException(java.lang.String msg, java.lang.Throwable cause)Constructor for TransactionSystemException.- Parameters:
msg- the detail messagecause- the root cause from the transaction API in use
-
-
Method Detail
-
initApplicationException
public void initApplicationException(java.lang.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:
java.lang.IllegalStateException- if this TransactionSystemException already holds an application exception
-
getApplicationException
@Nullable public final java.lang.Throwable getApplicationException()
Return the application exception that was thrown before this transaction exception, if any.- Returns:
- the application exception, or
nullif none set
-
getOriginalException
@Nullable public java.lang.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
nullif there was none
-
-