Class FHIRUserTransactionAdapter

  • All Implemented Interfaces:
    FHIRPersistenceTransaction

    public class FHIRUserTransactionAdapter
    extends java.lang.Object
    implements FHIRPersistenceTransaction
    Adapter to simplify transaction handling. This object is returned by FHIRPersistenceJDBCImpl and can be used instead of the old FHIRTransactionHelper
    • Constructor Summary

      Constructors 
      Constructor Description
      FHIRUserTransactionAdapter​(javax.transaction.UserTransaction tx, javax.transaction.TransactionSynchronizationRegistry syncRegistry, FHIRPersistenceJDBCCache cache, java.lang.String transactionDataKey, java.util.function.Consumer<java.lang.Boolean> afterTransactionHandler)
      Public constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void begin()
      If a transaction has not yet been started on this thread, then start one.
      void end()
      If we previously started a transaction on this thread using this helper instance, then commit it now.
      (package private) <T> T func​(java.util.function.Supplier<T> s)
      Call the supplier function within a begin/end
      protected int getStatus()
      Get the Status of the global transaction
      boolean hasBegun()
      Determine if the transaction status is currently active
      protected boolean isActive​(int status)
      Is there a transaction currently on this thread?
      protected boolean isMarkedForRollback​(int status)
      Has this transaction been marked for rollback?
      protected boolean isNoTransaction​(int status)
      Are we in the NO TRANSACTION state?
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait