Class HapiTransactionService

java.lang.Object
ca.uhn.fhir.jpa.dao.tx.HapiTransactionService
All Implemented Interfaces:
IHapiTransactionService

public class HapiTransactionService extends Object implements IHapiTransactionService
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setInterceptorBroadcaster

      public void setInterceptorBroadcaster(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
    • withRequest

      public IHapiTransactionService.IExecutionBuilder withRequest(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails)
      Description copied from interface: IHapiTransactionService
      Fluent builder for creating a transactional callback

      Method chain must end with a call to IHapiTransactionService.IExecutionBuilder.execute(Runnable) or one of the other overloads of task(...)

      Specified by:
      withRequest in interface IHapiTransactionService
    • execute

      @Deprecated public <T> T execute(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.support.TransactionCallback<T> theCallback)
      Deprecated.
      Use withRequest(RequestDetails) with fluent call instead
    • execute

      @Deprecated public void execute(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.annotation.Propagation thePropagation, @Nonnull org.springframework.transaction.annotation.Isolation theIsolation, @Nonnull Runnable theCallback)
      Deprecated.
      Use withRequest(RequestDetails) with fluent call instead
    • withRequest

      @Deprecated public <T> T withRequest(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.annotation.Propagation thePropagation, @Nonnull org.springframework.transaction.annotation.Isolation theIsolation, @Nonnull ca.uhn.fhir.util.ICallable<T> theCallback)
      Deprecated.
      Use withRequest(RequestDetails) with fluent call instead
      Specified by:
      withRequest in interface IHapiTransactionService
    • execute

      @Deprecated public <T> T execute(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.support.TransactionCallback<T> theCallback, @Nullable Runnable theOnRollback)
      Deprecated.
      Use withRequest(RequestDetails) with fluent call instead
    • execute

      @Deprecated public <T> T execute(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.support.TransactionCallback<T> theCallback, @Nullable Runnable theOnRollback, @Nullable org.springframework.transaction.annotation.Propagation thePropagation, @Nullable org.springframework.transaction.annotation.Isolation theIsolation)
      Deprecated.
    • execute

      @Deprecated public <T> T execute(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, @Nullable ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, @Nonnull org.springframework.transaction.support.TransactionCallback<T> theCallback, @Nullable Runnable theOnRollback, @Nonnull org.springframework.transaction.annotation.Propagation thePropagation, @Nonnull org.springframework.transaction.annotation.Isolation theIsolation, ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId)
      Deprecated.
      Use withRequest(RequestDetails) with fluent call instead
    • isCustomIsolationSupported

      public boolean isCustomIsolationSupported()
    • setRequestPartitionSvcForUnitTest

      public void setRequestPartitionSvcForUnitTest(IRequestPartitionHelperSvc theRequestPartitionHelperSvc)
    • getTransactionManager

      public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
    • setTransactionManager

      public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager theTransactionManager)
    • doExecute

      @Nullable protected <T> T doExecute(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback)
    • doExecuteCallback

      @Nullable protected <T> T doExecuteCallback(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback)
    • invokeCallableAndHandleAnyException

      public static <T> T invokeCallableAndHandleAnyException(Callable<T> theTask)
      Invokes Callable.call() and rethrows any exceptions thrown by that method. If the exception extends BaseServerResponseException it is rethrown unmodified. Otherwise, it's wrapped in a InternalErrorException.
    • executeWithDefaultPartitionInContext

      public static <T> T executeWithDefaultPartitionInContext(@Nonnull ca.uhn.fhir.util.ICallable<T> theCallback)
    • getRequestPartitionAssociatedWithThread

      public static ca.uhn.fhir.interceptor.model.RequestPartitionId getRequestPartitionAssociatedWithThread()