
Package ca.uhn.fhir.jpa.dao.tx
Class HapiTransactionService
java.lang.Object
ca.uhn.fhir.jpa.dao.tx.HapiTransactionService
- All Implemented Interfaces:
IHapiTransactionService
- Direct Known Subclasses:
NonTransactionalHapiTransactionService
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService
IHapiTransactionService.IExecutionBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.transaction.annotation.PropagationDefault value forsetTransactionPropagationWhenChangingPartitions(Propagation)protected ca.uhn.fhir.interceptor.api.IInterceptorBroadcasterprotected PartitionSettingsprotected IRequestPartitionHelperSvcprotected org.springframework.transaction.PlatformTransactionManagerstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildExecutionBuilder(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) protected <T> TdoExecute(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback) protected <T> TdoExecuteCallback(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback) voidexecute(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.annotation.Propagation thePropagation, org.springframework.transaction.annotation.Isolation theIsolation, Runnable theCallback) Deprecated.<T> Texecute(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.support.TransactionCallback<T> theCallback) Deprecated.UsewithRequest(RequestDetails)with fluent call instead<T> Texecute(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.support.TransactionCallback<T> theCallback, Runnable theOnRollback) Deprecated.UsewithRequest(RequestDetails)with fluent call instead<T> Texecute(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.support.TransactionCallback<T> theCallback, Runnable theOnRollback, org.springframework.transaction.annotation.Propagation thePropagation, org.springframework.transaction.annotation.Isolation theIsolation) Deprecated.UsewithRequest(RequestDetails)with fluent call instead<T> Texecute(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.support.TransactionCallback<T> theCallback, Runnable theOnRollback, org.springframework.transaction.annotation.Propagation thePropagation, org.springframework.transaction.annotation.Isolation theIsolation, RequestPartitionId theRequestPartitionId) Deprecated.UsewithRequest(RequestDetails)with fluent call insteadstatic <T> TexecuteWithDefaultPartitionInContext(ca.uhn.fhir.util.ICallable<T> theCallback) static RequestPartitionIdorg.springframework.transaction.PlatformTransactionManagerstatic <T> TinvokeCallableAndHandleAnyException(Callable<T> theTask) InvokesCallable.call()and rethrows any exceptions thrown by that method.booleanisCompatiblePartition(RequestPartitionId theRequestPartitionId, RequestPartitionId theOtherRequestPartitionId) Are two RequestPartitionId values compatible within the same transaction?booleanprotected booleanstatic voidThrows anIllegalArgumentExceptionif a transaction is activestatic voidThrows anIllegalArgumentExceptionif no transaction is activevoidsetInterceptorBroadcaster(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster) voidsetPartitionSettingsForUnitTest(PartitionSettings thePartitionSettings) voidsetRequestPartitionSvcForUnitTest(IRequestPartitionHelperSvc theRequestPartitionHelperSvc) voidsetSleepUtil(ca.uhn.fhir.util.SleepUtil theSleepUtil) voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager theTransactionManager) voidsetTransactionPropagationWhenChangingPartitions(org.springframework.transaction.annotation.Propagation theTransactionPropagationWhenChangingPartitions) withRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Fluent builder for creating a transactional callback<T> TwithRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, org.springframework.transaction.annotation.Propagation thePropagation, org.springframework.transaction.annotation.Isolation theIsolation, ca.uhn.fhir.util.ICallable<T> theCallback) Deprecated.UsewithRequest(RequestDetails)with fluent call insteadFluent builder for internal system requests with no external requestdetails associatedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService
withSystemRequestOnDefaultPartition, withSystemRequestOnPartition
-
Field Details
-
XACT_USERDATA_KEY_RESOLVED_TAG_DEFINITIONS
-
XACT_USERDATA_KEY_EXISTING_SEARCH_PARAMS
-
DEFAULT_TRANSACTION_PROPAGATION_WHEN_CHANGING_PARTITIONS
public static final org.springframework.transaction.annotation.Propagation DEFAULT_TRANSACTION_PROPAGATION_WHEN_CHANGING_PARTITIONSDefault value forsetTransactionPropagationWhenChangingPartitions(Propagation)- Since:
- 7.6.0
-
myInterceptorBroadcaster
-
myTransactionManager
@Autowired protected org.springframework.transaction.PlatformTransactionManager myTransactionManager -
myRequestPartitionHelperSvc
-
myPartitionSettings
-
-
Constructor Details
-
HapiTransactionService
public HapiTransactionService()
-
-
Method Details
-
setInterceptorBroadcaster
public void setInterceptorBroadcaster(ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster) -
setSleepUtil
-
withRequest
public IHapiTransactionService.IExecutionBuilder withRequest(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Description copied from interface:IHapiTransactionServiceFluent builder for creating a transactional callbackMethod chain must end with a call to
IHapiTransactionService.IExecutionBuilder.execute(Runnable)or one of the other overloads oftask(...)- Specified by:
withRequestin interfaceIHapiTransactionService
-
withSystemRequest
Description copied from interface:IHapiTransactionServiceFluent builder for internal system requests with no external requestdetails associated- Specified by:
withSystemRequestin interfaceIHapiTransactionService
-
buildExecutionBuilder
protected IHapiTransactionService.IExecutionBuilder buildExecutionBuilder(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) -
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.UsewithRequest(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.UsewithRequest(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.UsewithRequest(RequestDetails)with fluent call instead- Specified by:
withRequestin interfaceIHapiTransactionService
-
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.UsewithRequest(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.UsewithRequest(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, @Nonnull org.springframework.transaction.annotation.Propagation thePropagation, @Nonnull org.springframework.transaction.annotation.Isolation theIsolation, RequestPartitionId theRequestPartitionId) Deprecated.UsewithRequest(RequestDetails)with fluent call instead -
isCustomIsolationSupported
-
setRequestPartitionSvcForUnitTest
public void setRequestPartitionSvcForUnitTest(IRequestPartitionHelperSvc theRequestPartitionHelperSvc) -
getTransactionManager
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager theTransactionManager) -
setPartitionSettingsForUnitTest
-
doExecute
@Nullable protected <T> T doExecute(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback) -
isRequiresNewTransactionWhenChangingPartitions
-
isCompatiblePartition
public boolean isCompatiblePartition(RequestPartitionId theRequestPartitionId, RequestPartitionId theOtherRequestPartitionId) Description copied from interface:IHapiTransactionServiceAre two RequestPartitionId values compatible within the same transaction?This is an experimental API, subject to change in a future release.
- Specified by:
isCompatiblePartitionin interfaceIHapiTransactionService
-
setTransactionPropagationWhenChangingPartitions
public void setTransactionPropagationWhenChangingPartitions(org.springframework.transaction.annotation.Propagation theTransactionPropagationWhenChangingPartitions) -
doExecuteCallback
@Nullable protected <T> T doExecuteCallback(HapiTransactionService.ExecutionBuilder theExecutionBuilder, org.springframework.transaction.support.TransactionCallback<T> theCallback) -
invokeCallableAndHandleAnyException
InvokesCallable.call()and rethrows any exceptions thrown by that method. If the exception extendsBaseServerResponseExceptionit is rethrown unmodified. Otherwise, it's wrapped in aInternalErrorException. -
executeWithDefaultPartitionInContext
public static <T> T executeWithDefaultPartitionInContext(@Nonnull ca.uhn.fhir.util.ICallable<T> theCallback) -
getRequestPartitionAssociatedWithThread
-
noTransactionAllowed
Throws anIllegalArgumentExceptionif a transaction is active -
requireTransaction
Throws anIllegalArgumentExceptionif no transaction is active
-
withRequest(RequestDetails)with fluent call instead