Fix syntax error in DistributedLock "DELETE"
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
diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java
index 6f83ea1..7d58b8d 100644
--- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java
+++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockManager.java
@@ -769,8 +769,8 @@
*/
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);