Package lumis.util

Interface ITransaction

    • Method Detail

      • close

        void close()
        Closes this transaction, rolling back any changes not committed by a previous call to commit(), and removes any association of this transaction from the current thread.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Since:
        8.0.0
      • isActive

        boolean isActive()
        Returns true if the transaction is currently active, false otherwise.
        Returns:
        true if the transaction is currently active, false otherwise.
        Since:
        4.1.0
      • addObserver

        boolean addObserver​(ITransactionObserver observer)
                     throws PortalException
        Adds an observer for this transaction. The observer is added only if the current observer list does not already contain it.
        Parameters:
        observer - the observer.
        Returns:
        true if the observer was added, false otherwise.
        Throws:
        PortalException
        Since:
        4.0.8
      • removeObserver

        boolean removeObserver​(ITransactionObserver observer)
                        throws PortalException
        Removes an observer for this transaction. If the current observer list does not contain the given observer nothing happens.
        Parameters:
        observer - the observer.
        Returns:
        true if the observer was removed, false otherwise.
        Throws:
        PortalException
        Since:
        4.1.0
      • getByConnectionId

        ITransaction getByConnectionId​(String id)
                                throws DaoException
        Returns an ITransaction that represents the same transaction but that returns the connection with the given id as default. How the id represents the connection is defined by the concrete class that implements this interface.
        Parameters:
        id - the connection id.
        Returns:
        the ITransaction object.
        Throws:
        DaoException
        Since:
        4.0.4
      • getAttribute

        Object getAttribute​(String name)
        Returns the value of the named attribute, or null if no attribute of the given name exists.

        Different transaction instances that refer to the same transaction (see getByConnectionId(String)) share the same attributes.

        Parameters:
        name - the name of the attribute.
        Returns:
        the value of the attribute, or null if the attribute does not exist.
        Since:
        4.1.0
      • setAttribute

        void setAttribute​(String name,
                          Object value)
        Stores an attribute in this transaction. If the value passed in is null, the effect is the same as calling removeAttribute(String).
        Parameters:
        name - the name of the attribute.
        value - the value to be stored.
        Since:
        4.1.0
      • removeAttribute

        void removeAttribute​(String name)
        Removes an attribute from this transaction.
        Parameters:
        name - the name of the attribute.
        Since:
        4.1.0