From 30c88fc679a09e1a1cec093582e855dfd111eac8 Mon Sep 17 00:00:00 2001 From: gtully Date: Thu, 4 Oct 2018 16:47:16 +0100 Subject: [PATCH] ARTEMIS-2110 allow a lease renew without update to the expiry timestamp. Fix intermittent failure of org.apache.activemq.artemis.core.server.impl.jdbc.JdbcLeaseLockTest#shouldRenewAcquiredLock --- artemis-jdbc-store/src/main/resources/journal-sql.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artemis-jdbc-store/src/main/resources/journal-sql.properties b/artemis-jdbc-store/src/main/resources/journal-sql.properties index bf758b86ff..b8877ba2cb 100644 --- a/artemis-jdbc-store/src/main/resources/journal-sql.properties +++ b/artemis-jdbc-store/src/main/resources/journal-sql.properties @@ -41,7 +41,7 @@ create-state=INSERT INTO %s (ID) VALUES (%s) try-acquire-lock=UPDATE %s SET HOLDER_ID = ?, HOLDER_EXPIRATION_TIME = ? WHERE (HOLDER_EXPIRATION_TIME IS NULL OR (HOLDER_EXPIRATION_TIME < CURRENT_TIMESTAMP AND ? > CURRENT_TIMESTAMP)) AND ID = %s try-release-lock=UPDATE %s SET HOLDER_ID = NULL, HOLDER_EXPIRATION_TIME = NULL WHERE HOLDER_ID = ? AND ID = %s is-locked=SELECT HOLDER_ID, HOLDER_EXPIRATION_TIME, CURRENT_TIMESTAMP FROM %s WHERE ID = %s -renew-lock=UPDATE %s SET HOLDER_EXPIRATION_TIME = ? WHERE HOLDER_ID = ? AND HOLDER_EXPIRATION_TIME IS NOT NULL AND ? > HOLDER_EXPIRATION_TIME AND ? > CURRENT_TIMESTAMP AND ID = %s +renew-lock=UPDATE %s SET HOLDER_EXPIRATION_TIME = ? WHERE HOLDER_ID = ? AND HOLDER_EXPIRATION_TIME IS NOT NULL AND ? >= HOLDER_EXPIRATION_TIME AND ? > CURRENT_TIMESTAMP AND ID = %s current-timestamp=SELECT CURRENT_TIMESTAMP FROM %s write-state=UPDATE %s SET STATE = ? WHERE ID = %s read-state=SELECT STATE FROM %s WHERE ID = %s