plugins/org.apache.karaf.eik.app/src/main/java/org/apache/karaf/main/OracleJDBCLock.java [152:180]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean lock() {
        PreparedStatement statement = null;
        boolean result = false;
        try {
            if (!setUpdateCursor()) {
                LOG.severe("Could not set DB update cursor");
                return result;
            }
            LOG.fine("OracleJDBCLock#lock:: have set Update Cursor, now do update");
            long time = System.currentTimeMillis();
            statement = lockConnection.prepareStatement(statements.getLockUpdateStatement(time));
            int rows = statement.executeUpdate();
            LOG.fine("OracleJDBCLock#lock:: Number of update rows: " + rows);
            if (rows >= 1) {
                result=true;
            }
        } catch (Exception e) {
            LOG.warning("Failed to acquire database lock: " + e.getMessage());
        }finally {
            if (statement != null) {
                try {
                    statement.close();
                } catch (SQLException e) {
                    LOG.severe("Failed to close statement" + e);
                }
            }
        }
        return result;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.karaf.eik.app/src/main/java/org/apache/karaf/main/MySQLJDBCLock.java [148:176]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean lock() {
        PreparedStatement statement = null;
        boolean result = false;
        try {
            if (!setUpdateCursor()) {
                LOG.severe("Could not set DB update cursor");
                return result;
            }
            LOG.fine("MySQLJDBCLock#lock:: have set Update Cursor, now do update");
            long time = System.currentTimeMillis();
            statement = lockConnection.prepareStatement(statements.getLockUpdateStatement(time));
            int rows = statement.executeUpdate();
            LOG.fine("MySQLJDBCLock#lock:: Number of update rows: " + rows);
            if (rows >= 1) {
                result=true;
            }
        } catch (Exception e) {
            LOG.warning("Failed to acquire database lock: " + e.getMessage());
        }finally {
            if (statement != null) {
                try {
                    statement.close();
                } catch (SQLException e) {
                    LOG.severe("Failed to close statement" + e);
                }
            }
        }
        return result;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



