Top Description Methods
org.springframework.transaction.support

public Interface SmartTransactionObject

extends Flushable
Known Direct Implementers
org.springframework.transaction.jta.JtaTransactionObject
Imports
java.io.Flushable

Interface to be implemented by transaction objects that are able to return an internal rollback-only marker, typically from another transaction that has participated and marked it as rollback-only.

Autodetected by DefaultTransactionStatus in order to always return a current rollbackOnly flag even if not resulting from the current TransactionStatus.

Author
Juergen Hoeller
Since
1.1
See Also
DefaultTransactionStatus#isGlobalRollbackOnly()

Method Summary

Modifier and TypeMethod and Description
public default void
flush()

Implements java.io.Flushable.flush.

Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.

public default boolean
isRollbackOnly()

Return whether the transaction is internally marked as rollback-only.

Method Detail

flushback to summary
public default void flush()

Implements java.io.Flushable.flush.

Flush the underlying sessions to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.

The default implementation is empty, considering flush as a no-op.

Annotations
@Override
isRollbackOnlyback to summary
public default boolean isRollbackOnly()

Return whether the transaction is internally marked as rollback-only. Can, for example, check the JTA UserTransaction.

The default implementation returns false.

See Also
jakarta.transaction.UserTransaction#getStatus, jakarta.transaction.Status#STATUS_MARKED_ROLLBACK