Top Description Methods
org.springframework.transaction

public Interface TransactionStatus

extends TransactionExecution, SavepointManager, Flushable
Known Direct Implementers
org.springframework.transaction.support.AbstractTransactionStatus
Imports
java.io.Flushable

Representation of an ongoing PlatformTransactionManager transaction. Extends the common TransactionExecution interface.

Transactional code can use this to retrieve status information, and to programmatically request a rollback (instead of throwing an exception that causes an implicit rollback).

Includes the SavepointManager interface to provide access to savepoint management facilities. Note that savepoint management is only available if supported by the underlying transaction manager.

Author
Juergen Hoeller
Since
27.03.2003
See Also
setRollbackOnly(), PlatformTransactionManager#getTransaction, org.springframework.transaction.support.TransactionCallback#doInTransaction, org.springframework.transaction.interceptor.TransactionInterceptor#currentTransactionStatus()

Method Summary

Modifier and TypeMethod and Description
public default void
flush()

Implements java.io.Flushable.flush.

Flush the underlying session to the datastore, if applicable: for example, all affected Hibernate/JPA sessions.
public default boolean
hasSavepoint()

Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.

Inherited from org.springframework.transaction.SavepointManager:
createSavepointreleaseSavepointrollbackToSavepoint
Inherited from org.springframework.transaction.TransactionExecution:
getTransactionNamehasTransactionisCompletedisNestedisNewTransactionisReadOnlyisRollbackOnlysetRollbackOnly

Method Detail

flushback to summary
public default void flush()

Implements java.io.Flushable.flush.

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

This is effectively just a hint and may be a no-op if the underlying transaction manager does not have a flush concept. A flush signal may get applied to the primary resource or to transaction synchronizations, depending on the underlying resource.

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

Annotations
@Override
hasSavepointback to summary
public default boolean hasSavepoint()

Return whether this transaction internally carries a savepoint, that is, has been created as nested transaction based on a savepoint.

This method is mainly here for diagnostic purposes, alongside isNewTransaction(). For programmatic handling of custom savepoints, use the operations provided by SavepointManager.

The default implementation returns false.

See Also
isNewTransaction(), createSavepoint(), rollbackToSavepoint(Object), releaseSavepoint(Object)