
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 int
static final Pattern
Matches conditional URLs in the form of [resourceType]?[paramName]=[paramValue]{...more params...}Fields inherited from class ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
INVALID_PLACEHOLDER_PATTERN, UNQUALIFIED_MATCH_URL_START, URN_PREFIX, URN_PREFIX_ESCAPED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EntriesToProcessMap
doTransactionWriteOperations
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, 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 void
flushSession
(Map<org.hl7.fhir.instance.model.api.IIdType, DaoMethodOutcome> theIdToPersistedOutcome) protected void
protected void
postTransactionProcess
(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) 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.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 theResourceIndexedSearchParamToken
table for any rows that have the specific sys+val or val hashes we know we need to pre-fetch.void
setApplicationContextForUnitTest
(org.springframework.context.ApplicationContext theAppCtx) void
setEntityManagerForUnitTest
(jakarta.persistence.EntityManager theEntityManager) void
setFhirContextForUnitTest
(ca.uhn.fhir.context.FhirContext theFhirContext) void
setIdHelperServiceForUnitTest
(IIdHelperService<JpaPid> theIdHelperService) void
setStorageSettings
(StorageSettings theStorageSettings) protected void
Methods inherited from class ca.uhn.fhir.jpa.dao.BaseTransactionProcessor
collection, determineRequestPartitionIdForWriteEntries, getVersionAdapter, isPlaceholder, performIdSubstitutionsInMatchUrl, setContext, setDaoRegistry, setHapiTransactionService, setPartitionSettingsForUnitTest, setTxManager, setVersionAdapter, 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:
validateDependencies
in classBaseTransactionProcessor
-
setFhirContextForUnitTest
-
setStorageSettings
- Overrides:
setStorageSettings
in classBaseTransactionProcessor
-
doTransactionWriteOperations
protected EntriesToProcessMap doTransactionWriteOperations(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, 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:
doTransactionWriteOperations
in classBaseTransactionProcessor
-
postTransactionProcess
protected void postTransactionProcess(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Overrides:
postTransactionProcess
in classBaseTransactionProcessor
-
handleVerbChangeInTransactionWriteOperations
- Overrides:
handleVerbChangeInTransactionWriteOperations
in 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 theResourceIndexedSearchParamToken
table 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:
flushSession
in classBaseTransactionProcessor
-
setIdHelperServiceForUnitTest
-
setApplicationContextForUnitTest
public void setApplicationContextForUnitTest(org.springframework.context.ApplicationContext theAppCtx)
-