Skip to content

Commit

Permalink
issue #3437 skip parameter storage for remote index with derby and db2
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
  • Loading branch information
punktilious committed Jun 17, 2022
1 parent 150e3c3 commit 5aa9325
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.ibm.fhir.persistence.exception.FHIRPersistenceDataAccessException;
import com.ibm.fhir.persistence.exception.FHIRPersistenceException;
import com.ibm.fhir.persistence.exception.FHIRPersistenceVersionIdMismatchException;
import com.ibm.fhir.persistence.index.FHIRRemoteIndexService;
import com.ibm.fhir.persistence.jdbc.FHIRPersistenceJDBCCache;
import com.ibm.fhir.persistence.jdbc.connection.FHIRDbFlavor;
import com.ibm.fhir.persistence.jdbc.dao.api.FHIRDAOConstants;
Expand Down Expand Up @@ -572,8 +573,11 @@ public Resource insert(Resource resource, List<ExtractedParameterValue> paramete
// TODO FHIR_ADMIN schema name needs to come from the configuration/context
// We can skip the parameter insert if we've been given parameterHashB64 and
// it matches the current value just returned by the stored procedure call
FHIRRemoteIndexService remoteIndexService = FHIRRemoteIndexService.getServiceInstance();
long paramInsertStartTime = latestTime;
if (parameters != null && (parameterHashB64 == null || !parameterHashB64.equals(currentHash))) {
if (remoteIndexService == null
&& parameters != null && (parameterHashB64 == null || parameterHashB64.isEmpty()
|| !parameterHashB64.equals(currentHash))) {
JDBCIdentityCache identityCache = new JDBCIdentityCacheImpl(cache, this, parameterDao, getResourceReferenceDAO());
try (ParameterVisitorBatchDAO pvd = new ParameterVisitorBatchDAO(connection, "FHIR_ADMIN", resource.getResourceType(), true,
resource.getId(), 100, identityCache, resourceReferenceDAO, this.transactionData)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.ibm.fhir.persistence.exception.FHIRPersistenceDataAccessException;
import com.ibm.fhir.persistence.exception.FHIRPersistenceException;
import com.ibm.fhir.persistence.exception.FHIRPersistenceVersionIdMismatchException;
import com.ibm.fhir.persistence.index.FHIRRemoteIndexService;
import com.ibm.fhir.persistence.jdbc.FHIRPersistenceJDBCCache;
import com.ibm.fhir.persistence.jdbc.connection.FHIRDbFlavor;
import com.ibm.fhir.persistence.jdbc.dao.api.FHIRDAOConstants;
Expand Down Expand Up @@ -545,7 +546,8 @@ public long storeResource(String tablePrefix, List<ExtractedParameterValue> para
// To keep things simple for the Derby use-case, we just use a visitor to
// handle inserts of parameters directly in the resource parameter tables.
// Note we don't get any parameters for the resource soft-delete operation
if (parameters != null && requireParameterUpdate) {
FHIRRemoteIndexService remoteIndexService = FHIRRemoteIndexService.getServiceInstance();
if (remoteIndexService == null && parameters != null && requireParameterUpdate) {
// Derby doesn't support partitioned multi-tenancy, so we disable it on the DAO:
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Storing parameters for: " + v_resource_type + "/" + p_logical_id);
Expand Down

0 comments on commit 5aa9325

Please sign in to comment.