Module io.ebean.api
Package io.ebean

Interface TransactionCallback

All Known Implementing Classes:
TransactionCallbackAdapter

public interface TransactionCallback
Provides a callback that can be registered with a Transaction.

The callback methods are called just prior to and after the transaction performs a commit or rollback.

A typical use of TransactionCallback would be to clean up non-transactional resources like files. For example, when processing files on postCommit/postRollback clean up the associated files. As another example when on postCommit of a delete remove associated resources from the file system or remote service.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Perform processing just after the transaction commit.
    void
    Perform processing just after the transaction rollback.
    void
    Perform processing just prior to the transaction commit.
    void
    Perform processing just prior to the transaction rollback.
  • Method Details

    • preCommit

      void preCommit()
      Perform processing just prior to the transaction commit.
    • postCommit

      void postCommit()
      Perform processing just after the transaction commit.
    • preRollback

      void preRollback()
      Perform processing just prior to the transaction rollback.
    • postRollback

      void postRollback()
      Perform processing just after the transaction rollback.