
Package ca.uhn.fhir.jpa.dao
Class TransactionProcessor
java.lang.Object
ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
ca.uhn.fhir.jpa.dao.TransactionProcessor
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
BaseTransactionProcessor.RetriableBundleTask, BaseTransactionProcessor.TransactionSorter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final PatternMatches conditional URLs in the form of [resourceType]?Fields inherited from class ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
INVALID_PLACEHOLDER_PATTERN, myHapiTransactionService, UNQUALIFIED_MATCH_URL_START, URN_PREFIX, URN_PREFIX_ESCAPED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EntriesToProcessMapdoTransactionWriteOperations(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, RequestPartitionId theRequestPartitionId, String theActionName, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, Set<org.hl7.fhir.instance.model.api.IIdType> theAllIds, IdSubstitutionMap theIdSubstitutions, Map<org.hl7.fhir.instance.model.api.IIdType, DaoMethodOutcome> theIdToPersistedOutcome, org.hl7.fhir.instance.model.api.IBaseBundle theResponse, IdentityHashMap<org.hl7.fhir.instance.model.api.IBase, Integer> theOriginalRequestOrder, List<org.hl7.fhir.instance.model.api.IBase> theEntries, StopWatch theTransactionStopWatch) protected voidflushSession(Map<org.hl7.fhir.instance.model.api.IIdType, DaoMethodOutcome> theIdToPersistedOutcome) protected voidprotected voidpostTransactionProcess(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) voidpreFetchSearchParameterMaps(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, RequestPartitionId theRequestPartitionId, List<TransactionProcessor.MatchUrlToResolve> theInputParameters, Set<JpaPid> theOutputPidsToLoadBodiesFor, Set<JpaPid> theOutputPidsToLoadVersionsFor) This method attempts to resolve a collection of conditional URLs that were found in a FHIR transaction bundle being processed.voidpreFetchSearchParameterMapsToken(String theIndexColumnName, Set<Long> theHashesForIndexColumn, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, RequestPartitionId theRequestPartitionId, List<TransactionProcessor.MatchUrlToResolve> theInputParameters, Set<JpaPid> theOutputPidsToLoadFully, Set<JpaPid> theOutputPidsToLoadVersionsFor) Here we do a select against theResourceIndexedSearchParamTokentable for any rows that have the specific sys+val or val hashes we know we need to pre-fetch.voidsetApplicationContextForUnitTest(org.springframework.context.ApplicationContext theAppCtx) voidsetEntityManagerForUnitTest(jakarta.persistence.EntityManager theEntityManager) voidsetFhirContextForUnitTest(ca.uhn.fhir.context.FhirContext theFhirContext) voidsetIdHelperServiceForUnitTest(IIdHelperService<JpaPid> theIdHelperService) voidsetStorageSettings(StorageSettings theStorageSettings) protected voidMethods inherited from class ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
collection, determineRequestPartitionIdForWriteEntries, getVersionAdapter, isPlaceholder, performIdSubstitutionsInMatchUrl, setContext, setDaoRegistry, setHapiTransactionService, setInterceptorBroadcasterForUnitTest, setPartitionSettingsForUnitTest, setTxManager, setVersionAdapter, toStatusString, transaction
-
Field Details
-
MATCH_URL_PATTERN
Matches conditional URLs in the form of [resourceType]?[paramName]=[paramValue]{...more params...} -
CONDITIONAL_URL_FETCH_CHUNK_SIZE
- See Also:
-
-
Constructor Details
-
TransactionProcessor
public TransactionProcessor()
-
-
Method Details
-
setEntityManagerForUnitTest
-
validateDependencies
- Overrides:
validateDependenciesin classBaseTransactionProcessor
-
setFhirContextForUnitTest
-
setStorageSettings
- Overrides:
setStorageSettingsin classBaseTransactionProcessor
-
doTransactionWriteOperations
protected EntriesToProcessMap doTransactionWriteOperations(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, RequestPartitionId theRequestPartitionId, String theActionName, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, Set<org.hl7.fhir.instance.model.api.IIdType> theAllIds, IdSubstitutionMap theIdSubstitutions, Map<org.hl7.fhir.instance.model.api.IIdType, DaoMethodOutcome> theIdToPersistedOutcome, org.hl7.fhir.instance.model.api.IBaseBundle theResponse, IdentityHashMap<org.hl7.fhir.instance.model.api.IBase, Integer> theOriginalRequestOrder, List<org.hl7.fhir.instance.model.api.IBase> theEntries, StopWatch theTransactionStopWatch) - Overrides:
doTransactionWriteOperationsin classBaseTransactionProcessor
-
postTransactionProcess
protected void postTransactionProcess(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Overrides:
postTransactionProcessin classBaseTransactionProcessor
-
handleVerbChangeInTransactionWriteOperations
- Overrides:
handleVerbChangeInTransactionWriteOperationsin classBaseTransactionProcessor
-
preFetchSearchParameterMaps
public void preFetchSearchParameterMaps(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, RequestPartitionId theRequestPartitionId, List<TransactionProcessor.MatchUrlToResolve> theInputParameters, Set<JpaPid> theOutputPidsToLoadBodiesFor, Set<JpaPid> theOutputPidsToLoadVersionsFor) This method attempts to resolve a collection of conditional URLs that were found in a FHIR transaction bundle being processed.- Parameters:
theRequestDetails- The active requesttheTransactionDetails- The active transaction detailstheRequestPartitionId- The active partitiontheInputParameters- These are the conditional URLs that will actually be resolvedtheOutputPidsToLoadBodiesFor- This list will be added to with any resource PIDs that need to be fully preloaded (i.e. fetch the actual resource body since we're presumably going to update it and will need to see its current state eventually)theOutputPidsToLoadVersionsFor- This list will be added to with any resource PIDs that need to have their current version resolved. This is used for conditional creates, where we don't actually care about the body of the resource, only the version it has (since the version is returned in the response, and potentially used if we're auto-versioning references).
-
preFetchSearchParameterMapsToken
public void preFetchSearchParameterMapsToken(String theIndexColumnName, Set<Long> theHashesForIndexColumn, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, RequestPartitionId theRequestPartitionId, List<TransactionProcessor.MatchUrlToResolve> theInputParameters, Set<JpaPid> theOutputPidsToLoadFully, Set<JpaPid> theOutputPidsToLoadVersionsFor) Here we do a select against theResourceIndexedSearchParamTokentable for any rows that have the specific sys+val or val hashes we know we need to pre-fetch.Note that we do a tuple query for only 2 columns in order to ensure that we can get by with only the data in the index (ie no need to load the actual table rows).
-
flushSession
protected void flushSession(Map<org.hl7.fhir.instance.model.api.IIdType, DaoMethodOutcome> theIdToPersistedOutcome) - Specified by:
flushSessionin classBaseTransactionProcessor
-
setIdHelperServiceForUnitTest
-
setApplicationContextForUnitTest
public void setApplicationContextForUnitTest(org.springframework.context.ApplicationContext theAppCtx)
-