Interface Transaction

    • Method Detail

      • begin

        void begin​(boolean join)
            throws SystemException
        Begin a new transaction or join current transaction. Beginning a new transaction will commit current transaction.
        Parameters:
        join - whether to join current transaction
        Throws:
        SystemException - throw if an error occurs
      • setTransactionTimeout

        void setTransactionTimeout​(int timeout)
        Set transaction timeout. Timeout without activities.
        Parameters:
        timeout - timeout in milliseconds
      • isActive

        boolean isActive()
        Is current transaction active?
        Returns:
        true if active, false otherwise
      • getDataAccessUnit

        DataAccessUnit getDataAccessUnit()
        Get the DataAccessUnit of associated persistence unit.
        Returns:
        DataAccessUnit object. return null for JTA.
        Since:
        5.13
      • setDataAccessUnit

        void setDataAccessUnit​(DataAccessUnit dataAccessUnit)
                        throws SystemException
        Change dataAccessUnit. Ignored for JTA.

        If current transaction is active, commit it and start a new transaction for the new dataAccessUnit.

        Parameters:
        dataAccessUnit - instance type or instance.
        Throws:
        SystemException - throw if an error occurs