public void updateIfNewRow ( int iRowIndex ) throws DBException { if ( ( m_iCurrentLockedRowIndex != - 1 ) && ( m_iCurrentLockedRowIndex != iRowIndex ) ) if ( m_buffCurrentLockedData != null ) { { FieldList fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , false ) ; // Read this row if it isn't current if ( this . isRecordChanged ( ) ) { // Only update if there are changes. synchronized ( this ) { // This time do the physical read (last time I asked for the cache) DBException ex = null ; fieldList = this . makeRowCurrent ( m_iCurrentLockedRowIndex , true ) ; // Read this row if it isn't current if ( ( this . isAppending ( ) ) && ( ( m_iCurrentLockedRowIndex == m_iLastRecord + 1 ) && ( m_iLastRecord != RECORD_UNKNOWN ) ) ) { m_table . add ( fieldList ) ; // New record = add this . setCurrentRow ( - 1 ) ; // Make sure I don't try to use this unknown record without re-reading it. if ( m_iLastRecord != RECORD_UNKNOWN ) // Could have been set in 'add' m_iLastRecord ++ ; } else { if ( ( fieldList . getEditMode ( ) == Constants . EDIT_CURRENT ) || ( fieldList . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) ) { try { m_table . set ( fieldList ) ; // Current record = set } catch ( DBException e ) { ex = e ; } } this . setCurrentRow ( - 1 ) ; // Can't use current record anymore } m_iCurrentLockedRowIndex = - 1 ; m_buffCurrentLockedData = null ; if ( ex != null ) throw ex ; } } } } }
Update the currently updated record if the row is different from this row .