Fix syntax error in DistributedLock "DELETE" 79/97979/1
authorJim Hahn <jrh3@att.com>
Tue, 5 Nov 2019 19:47:08 +0000 (14:47 -0500)
committerJim Hahn <jrh3@att.com>
Tue, 5 Nov 2019 19:47:08 +0000 (14:47 -0500)
Changed the "DELETE" to "DELETE FROM" to fix this error:
  You have an error in your SQL syntax; check the manual that corresponds
  to your MariaDB server version for the right syntax to use

Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I10a398c13dc3da547d2b3ea47564ab0d5761a2ee

feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java

index 6f83ea1..7d58b8d 100644 (file)
@@ -769,8 +769,8 @@ public class DistributedLockManager extends LockManager<DistributedLockManager.D
          */
         protected void doDbDelete(Connection conn) throws SQLException {
             logger.debug("delete lock record {}", this);
-            try (PreparedStatement stmt =
-                            conn.prepareStatement("DELETE pooling.locks WHERE resourceId=? AND host=? AND owner=?")) {
+            try (PreparedStatement stmt = conn
+                            .prepareStatement("DELETE FROM pooling.locks WHERE resourceId=? AND host=? AND owner=?")) {
 
                 stmt.setString(1, getResourceId());
                 stmt.setString(2, this.hostName);