aboutsummaryrefslogtreecommitdiffstats
path: root/mdbc-server/src/main/java/org/onap/music/mdbc/MDBCUtils.java
diff options
context:
space:
mode:
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) {