@Override
    public void deleteServerLease(String recoveryIdentity) throws Exception {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "deleteServerLease", new java.lang.Object[] { recoveryIdentity, this });

        Connection conn = null;
        boolean sqlSuccess = false;
        SQLException currentSqlEx = null;

        Statement deleteStmt = null;

        try
        {
            // Have we acquired the reference to the DataSource yet?
            if (_theDS == null)
            {
                _theDS = getDataSourceFromProperties();
                // We've looked up the DS, so now we can get a JDBC connection
                if (_theDS != null)
                {
                    conn = getConnection(_theDS);
                }
            }
            else
            {
                // Try and get a new connection
                conn = _theDS.getConnection();
            }

            // If we were unable to get a connection, throw an exception
            if (conn == null)
            {
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "deleteServerLease", "Null connection InternalLogException");
                throw new InternalLogException("Failed to get JDBC Connection", null);
            }

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Set autocommit FALSE on the connection");
            conn.setAutoCommit(false);

            // We can go ahead and write to the Database
            deleteStmt = conn.createStatement();

            String deleteString = "DELETE FROM " + _leaseTableName +
                                  " WHERE SERVER_IDENTITY='" + recoveryIdentity + "'";
            if (tc.isDebugEnabled())
                Tr.debug(tc, "delete server lease for " + recoveryIdentity + "using string " + deleteString);

            int ret = deleteStmt.executeUpdate(deleteString);

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Have deleted row with return: " + ret + ", commit the change");

            conn.commit();
            Tr.audit(tc, "WTRN0108I: Deleted Lease for server with recovery identity " + recoveryIdentity);
        }
        // Catch and report an SQLException. In the finally block we'll determine whether the condition is transient or not.
        catch (SQLException sqlex)
        {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Lease delete failed with exception: " + sqlex);
        } finally
        {

            if (deleteStmt != null && !deleteStmt.isClosed())
                deleteStmt.close();
            if (conn != null)
                conn.close();
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "deleteServerLease");
    }
@ Override public void deleteServerLease ( String recoveryIdentity ) throws Exception { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deleteServerLease" , new java . lang . Object [ ] { recoveryIdentity , this } ) ; Connection conn = null ; boolean sqlSuccess = false ; SQLException currentSqlEx = null ; Statement deleteStmt = null ; try { if ( _theDS == null ) { _theDS = getDataSourceFromProperties ( ) ; if ( _theDS != null ) { conn = getConnection ( _theDS ) ; } } else { conn = _theDS . getConnection ( ) ; } if ( conn == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deleteServerLease" , "Null connection InternalLogException" ) ; throw new InternalLogException ( "Failed to get JDBC Connection" , null ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Set autocommit FALSE on the connection" ) ; conn . setAutoCommit ( false ) ; deleteStmt = conn . createStatement ( ) ; String deleteString = "DELETE FROM " + _leaseTableName + " WHERE SERVER_IDENTITY='" + recoveryIdentity + "'" ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "delete server lease for " + recoveryIdentity + "using string " + deleteString ) ; int ret = deleteStmt . executeUpdate ( deleteString ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Have deleted row with return: " + ret + ", commit the change" ) ; conn . commit ( ) ; Tr . audit ( tc , "WTRN0108I: Deleted Lease for server with recovery identity " + recoveryIdentity ) ; } catch ( SQLException sqlex ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Lease delete failed with exception: " + sqlex ) ; } finally { if ( deleteStmt != null && ! deleteStmt . isClosed ( ) ) deleteStmt . close ( ) ; if ( conn != null ) conn . close ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deleteServerLease" ) ; }
TODO:is deleted by a peer, could the original server not simply (re)insert its own row?