Interface FHIRPersistenceTransaction

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void begin()
      Begin a new transaction on the current thread if a transaction is not started yet.
      void end()
      End the current thread's transaction.
      boolean hasBegun()
      Determine if the transaction status is currently active
      default boolean isTransactional()
      Does the underlying implementation actually support transactions? A persistence layer must always return a FHIRPersistenceTransaction even if it doesn't support transactions.
      void setRollbackOnly()
      Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
    • Method Detail

      • isTransactional

        default boolean isTransactional()
        Does the underlying implementation actually support transactions? A persistence layer must always return a FHIRPersistenceTransaction even if it doesn't support transactions. This reduces boilerplate code by avoiding the need to check for null every time.
        Returns:
      • end

        void end()
          throws FHIRPersistenceException
        End the current thread's transaction. If setRollbackOnly has been called, then roll back the transaction instead. This call only affects the current transaction if this object actually started the transaction (i.e. is the outermost instance of a transaction).
        Throws:
        java.lang.Exception
        FHIRPersistenceException
      • setRollbackOnly

        void setRollbackOnly()
                      throws FHIRPersistenceException
        Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
        Throws:
        FHIRPersistenceException