aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
authorNiharika Sharma <niharika.sharma@amdocs.com>2021-04-06 13:43:18 -0400
committerNiharika Sharma <niharika.sharma@amdocs.com>2021-04-06 14:54:48 -0400
commit31c976e338645effcee4bbee5147453b3749830f (patch)
tree9db6d1da7b72e44fc5ea25842e21ef4ff57489e7 /aai-core
parent824cde0782a0e785a2ec1cd902863fc299902f8b (diff)
Fixed Concurrent Updates overriding the AAI object
Issue-ID: AAI-3308 Signed-off-by: Niharika Sharma <niharika.sharma@amdocs.com> Change-Id: I7d2d591928987b9f5f9465325fc1c4d03dee3db2
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
index 37d497ab..9f3e7475 100644
--- a/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
+++ b/aai-core/src/main/java/org/onap/aai/dbgen/SchemaGenerator.java
@@ -126,6 +126,14 @@ public class SchemaGenerator {
graphMgmt.setConsistency(propK, ConsistencyModifier.LOCK);
}
}
+ else if (dbPropName.equals("resource-version")) {
+ String aai_rv_lock_enabled = AAIConfig.get(AAIConstants.AAI_LOCK_RV_ENABLED, "false");
+ LOGGER.info(" Info: aai_rv_lock_enabled:" + aai_rv_lock_enabled);
+ if ("true".equals(aai_rv_lock_enabled)) {
+ LOGGER.info(" Lock is being set for resource-version Property.");
+ graphMgmt.setConsistency(propK, ConsistencyModifier.LOCK);
+ }
+ }
seenProps.put(dbPropName, propK);
} else {
propK = seenProps.get(dbPropName);
@@ -151,6 +159,14 @@ public class SchemaGenerator {
graphMgmt.setConsistency(indexG, ConsistencyModifier.LOCK);
}
}
+ else if (indexG != null && dbPropName.equals("resource-version")) {
+ String aai_rv_lock_enabled = AAIConfig.get(AAIConstants.AAI_LOCK_RV_ENABLED, "false");
+ LOGGER.info(" Info:: aai_rv_lock_enabled:" + aai_rv_lock_enabled);
+ if ("true".equals(aai_rv_lock_enabled)) {
+ LOGGER.info("Lock is being set for resource-version Index.");
+ graphMgmt.setConsistency(indexG, ConsistencyModifier.LOCK);
+ }
+ }
} else {
LOGGER.info("No index added for PropertyKey: [{}]", dbPropName);
}