aboutsummaryrefslogtreecommitdiffstats
path: root/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
diff options
context:
space:
mode:
authorTschaen, Brendan <ctschaen@att.com>2019-08-07 12:36:06 -0400
committerTschaen, Brendan <ctschaen@att.com>2019-08-07 12:36:06 -0400
commit14d46d99cb31f20da0bcfbdd559703cb97bf0baa (patch)
tree1319ab6254fb8435ad3ea398d8188a7c3fbc8e15 /mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
parenta98c068aa9a97b73aa1423f432674485a05bdb60 (diff)
Configurable "write only locks"
Issue-ID: MUSIC-466 Signed-off-by: Tschaen, Brendan <ctschaen@att.com> Change-Id: I29c9e0fab3432d152824080ac197a57e0eaf0eff
Diffstat (limited to 'mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java')
-rwxr-xr-xmdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java b/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
index b60062e..ee742f8 100755
--- a/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
+++ b/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
@@ -49,6 +49,7 @@ import org.apache.commons.lang3.tuple.Pair;
import org.json.JSONObject;
public class MDBCUtils {
+ public static boolean writeLocksOnly = false;
public static void saveToFile(String serializedContent, String filename, EELFLoggerDelegate logger) throws IOException {
try (PrintWriter fout = new PrintWriter(filename)) {
@@ -129,6 +130,10 @@ public class MDBCUtils {
* @return write if any table has a write query. Read otherwise
*/
public static SQLOperationType getOperationType(Map<String, List<SQLOperation>> tableToQueryType) {
+ if (writeLocksOnly) {
+ return SQLOperationType.WRITE;
+ }
+
for (List<org.onap.music.mdbc.query.SQLOperation> tablesOps : tableToQueryType.values()) {
for (org.onap.music.mdbc.query.SQLOperation op : tablesOps) {
if (op.getOperationType() != SQLOperationType.READ) {