Class TransactionCompletion
java.lang.Object
com.pyranid.TransactionCompletion
Immutable observation of one completed transaction boundary, after cleanup and post-transaction hooks.
The database result and the invocation failure describe different facts: a committed transaction can still fail during cleanup or a post-transaction hook. A normal rollback-only return has no failure. Nested independent transactions have separate completions even when the same failure escapes both boundaries.
The failure is the original throwable reference, not an immutable copy of that throwable.
- Since:
- 4.8.0
-
Method Summary
Modifier and TypeMethodDescriptionGets the identifier of the ambient transaction when this boundary started, including a different database's transaction when an independent nested transaction was started explicitly.Gets the exact throwable propagated by this invocation, including suppressed cleanup and hook failures.Gets this boundary's database outcome.Gets this boundary's identifier.
-
Method Details
-
getTransactionId
Gets this boundary's identifier. IDs correlate transactions within the process, not durable business operations.- Returns:
- transaction identifier
-
getEnclosingTransactionId
Gets the identifier of the ambient transaction when this boundary started, including a different database's transaction when an independent nested transaction was started explicitly.- Returns:
- enclosing transaction identifier, if any
-
getResult
Gets this boundary's database outcome. Scopes without physical JDBC work retain their logical commit or rollback result. This result does not describe the outcome of independently completed nested transactions.- Returns:
- transaction result
-
getFailure
Gets the exact throwable propagated by this invocation, including suppressed cleanup and hook failures. The throwable may subsequently gain suppressed failures as it crosses enclosing transaction boundaries.- Returns:
- invocation failure, or empty for a normal return
-