try
{
this.applyModificationAndLog( record, monitor );
// update cache and adjust attribute/children initialization flags
DN dn = new DN( record.getDnLine().getValueAsString() );
IEntry entry = connection.getEntryFromCache( dn );
DN parentDn = dn.getParentDn();
IEntry parentEntry = parentDn != null ? connection.getEntryFromCache( dn.getParentDn() ) : null;
if ( record instanceof LdifChangeDeleteRecord )
{
if ( entry != null )
{
entry.setAttributesInitialized( false );
connection.uncacheEntry( entry );
}
if ( parentEntry != null )
{
parentEntry.setChildrenInitialized( false );
}
}
else if ( record instanceof LdifChangeModDnRecord )
{
if ( entry != null )
{
entry.setAttributesInitialized( false );
connection.uncacheEntry( entry );
}
if ( parentEntry != null )
{
parentEntry.setChildrenInitialized( false );
}
LdifChangeModDnRecord modDnRecord = ( LdifChangeModDnRecord ) record;
if ( modDnRecord.getNewsuperiorLine() != null )
{
DN newSuperiorDn = new DN( modDnRecord.getNewsuperiorLine().getValueAsString() );
IEntry newSuperiorEntry = connection.getEntryFromCache( newSuperiorDn );
if ( newSuperiorEntry != null )
{
newSuperiorEntry.setChildrenInitialized( false );
}