code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 62bd68c2 authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1811 Correct the expiresTime parameter

parent 05143edd
......@@ -18,6 +18,7 @@ package org.onehippo.repository.lock.db;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.DataSource;
......@@ -56,7 +57,7 @@ public class DbLockRefresher implements Runnable {
final PreparedStatement locksToRefreshStatement = connection.prepareStatement(LOCKS_TO_REFRESH_BLOCKING_STATEMENT);
locksToRefreshStatement.setString(1, clusterNodeId);
// select all rows that have less than 20 seconds to live
locksToRefreshStatement.setLong(1, System.currentTimeMillis() + 20000);
locksToRefreshStatement.setLong(2, System.currentTimeMillis() + 20000);
ResultSet resultSet = locksToRefreshStatement.executeQuery();
while (resultSet.next()) {
// found lock to refresh
......@@ -69,7 +70,7 @@ public class DbLockRefresher implements Runnable {
unlockStatement.execute();
}
connection.commit();
} catch (Exception e) {
} catch (SQLException e) {
if (log.isDebugEnabled()) {
log.info("Exception in {} happened. Possibly another cluster node did already reset some lock rows:", this.getClass().getName(), e);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment