Interface SelectForUpdateBasedTransaction

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void begin()
      Begins transaction if underlying storage requires transactions.
      void commit()
      Commits transaction if underlying storage requires transactions
      void release()
      Frees resources associated with this transaction
      void rollback()
      Rollbacks transaction if underlying storage requires transactions
      boolean tryInsertEmptyData()
      Creates empty data by for the key associated with this transaction.
      LockAndGetResult tryLockAndGet()
      Locks data by the key associated with this transaction and returns data that is associated with the key.
      void update​(byte[] data, RemoteBucketState newState)
      Updates the data by the key associated with this transaction.
    • Method Detail

      • begin

        void begin()
        Begins transaction if underlying storage requires transactions. There is strong guarantee that commit() or rollback() will be called if begin() returns successfully.
      • rollback

        void rollback()
        Rollbacks transaction if underlying storage requires transactions
      • commit

        void commit()
        Commits transaction if underlying storage requires transactions
      • tryLockAndGet

        LockAndGetResult tryLockAndGet()
        Locks data by the key associated with this transaction and returns data that is associated with the key.
        Returns:
        the data by the key associated with this transaction, or null data associated with key does not exist
      • tryInsertEmptyData

        boolean tryInsertEmptyData()
        Creates empty data by for the key associated with this transaction. This operation is required to be able to lock data in the scope of next transaction.
        Returns:
        true if data has been inserted
      • update

        void update​(byte[] data,
                    RemoteBucketState newState)
        Updates the data by the key associated with this transaction.
        Parameters:
        data - bucket state to persists
        newState - new state of bucket - can be used to extract additional data is useful for persistence or logging.
      • release

        void release()
        Frees resources associated with this transaction