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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void postCommit()
      Perform processing just after the transaction commit.
      void postRollback()
      Perform processing just after the transaction rollback.
      void preCommit()
      Perform processing just prior to the transaction commit.
      void preRollback()
      Perform processing just prior to the transaction rollback.
    • Method Detail

      • 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.