aboutsummaryrefslogtreecommitdiffstats
path: root/music-rest
diff options
context:
space:
mode:
Diffstat (limited to 'music-rest')
-rw-r--r--music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java6
-rw-r--r--music-rest/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java b/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
index 18fa8a18..ebaa3a1f 100644
--- a/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
+++ b/music-rest/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
@@ -94,9 +94,9 @@ public class MusicConditional {
String key = keyspace + "." + tablename + "." + primaryKey;
String lockId;
try {
- lockId = MusicCore.createLockReference(key);
+ lockId = MusicCore.createLockReferenceAtomic(key);
} catch (MusicLockingException e) {
- return new ReturnType(ResultType.FAILURE, e.getMessage());
+ return new ReturnType(ResultType.FAILURE, e.getMessage());
}
long leasePeriod = MusicUtil.getDefaultLockLeasePeriod();
ReturnType lockAcqResult = MusicCore.acquireLockWithLease(key, lockId, leasePeriod);
@@ -169,7 +169,7 @@ public class MusicConditional {
throws MusicLockingException, MusicQueryException, MusicServiceException {
String key = dataObj.getKeyspace() + "." + dataObj.getTableName() + "." + dataObj.getPrimaryKeyValue();
- String lockId = MusicCore.createLockReference(key);
+ String lockId = MusicCore.createLockReferenceAtomic(key);
long leasePeriod = MusicUtil.getDefaultLockLeasePeriod();
ReturnType lockAcqResult = MusicCore.acquireLockWithLease(key, lockId, leasePeriod);
diff --git a/music-rest/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java b/music-rest/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
index e9321d25..91781a34 100644
--- a/music-rest/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
+++ b/music-rest/src/test/java/org/onap/music/unittests/TstRestMusicLockAPI.java
@@ -437,11 +437,11 @@ public class TstRestMusicLockAPI {
"abc66ccc-d857-4e90-b1e5-df98a3d40ce6", appName);
System.out.println("Status: " + response.getStatus() + ". Entity " + response.getEntity());
assertEquals(400, response.getStatus());
- }
+ }
- @SuppressWarnings("unchecked")
- @Test
- public void test_deadlock() throws Exception {
+ @SuppressWarnings("unchecked")
+ @Test
+ public void test_deadlock() throws Exception {
System.out.println("Testing deadlock");
createAndInsertIntoTable();
insertAnotherIntoTable();