private void reportLeasOwnerShipAndDuration(Connection connection) throws SQLException { PreparedStatement statement = null; try { statement = connection.prepareStatement(getStatements().getLeaseOwnerStatement()); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { LOG.debug(getLeaseHolderId() + " Lease held by " + resultSet.getString(1) + " till " + new Date(resultSet.getLong(2))); } } finally { close(statement); } }
private void releaseLease() { Connection connection = null; PreparedStatement statement = null; try { connection = getConnection(); statement = connection.prepareStatement(getStatements().getLeaseUpdateStatement()); statement.setString(1, null); statement.setLong(2, 0l); statement.setString(3, getLeaseHolderId()); if (statement.executeUpdate() == 1) { LOG.info(getLeaseHolderId() + ", released lease"); } } catch (Exception e) { LOG.error(getLeaseHolderId() + " failed to release lease: " + e, e); } finally { close(statement); close(connection); } }
private void reportLeasOwnerShipAndDuration(Connection connection) throws SQLException { PreparedStatement statement = null; try { statement = connection.prepareStatement(getStatements().getLeaseOwnerStatement()); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { LOG.debug(getLeaseHolderId() + " Lease held by " + resultSet.getString(1) + " till " + new Date(resultSet.getLong(2))); } } finally { close(statement); } }
private void reportLeasOwnerShipAndDuration(Connection connection) throws SQLException { PreparedStatement statement = null; try { statement = connection.prepareStatement(getStatements().getLeaseOwnerStatement()); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { LOG.debug(getLeaseHolderId() + " Lease held by " + resultSet.getString(1) + " till " + new Date(resultSet.getLong(2))); } } finally { close(statement); } }
private void reportLeasOwnerShipAndDuration(Connection connection) throws SQLException { PreparedStatement statement = null; try { statement = connection.prepareStatement(getStatements().getLeaseOwnerStatement()); ResultSet resultSet = statement.executeQuery(); while (resultSet.next()) { LOG.debug(getLeaseHolderId() + " Lease held by " + resultSet.getString(1) + " till " + new Date(resultSet.getLong(2))); } } finally { close(statement); } }
private void releaseLease() { Connection connection = null; PreparedStatement statement = null; try { connection = getConnection(); statement = connection.prepareStatement(getStatements().getLeaseUpdateStatement()); statement.setString(1, null); statement.setLong(2, 0l); statement.setString(3, getLeaseHolderId()); if (statement.executeUpdate() == 1) { LOG.info(getLeaseHolderId() + ", released lease"); } } catch (Exception e) { LOG.error(getLeaseHolderId() + " failed to release lease: " + e, e); } finally { close(statement); close(connection); } }
private void releaseLease() { Connection connection = null; PreparedStatement statement = null; try { connection = getConnection(); statement = connection.prepareStatement(getStatements().getLeaseUpdateStatement()); statement.setString(1, null); statement.setLong(2, 0l); statement.setString(3, getLeaseHolderId()); if (statement.executeUpdate() == 1) { LOG.info(getLeaseHolderId() + ", released lease"); } } catch (Exception e) { LOG.error(getLeaseHolderId() + " failed to release lease: " + e, e); } finally { close(statement); close(connection); } }
private void releaseLease() { Connection connection = null; PreparedStatement statement = null; try { connection = getConnection(); statement = connection.prepareStatement(getStatements().getLeaseUpdateStatement()); statement.setString(1, null); statement.setLong(2, 0l); statement.setString(3, getLeaseHolderId()); if (statement.executeUpdate() == 1) { LOG.info(getLeaseHolderId() + ", released lease"); } } catch (Exception e) { LOG.error(getLeaseHolderId() + " failed to release lease: " + e, e); } finally { close(statement); close(connection); } }