public void handleDirectUpdateSA(Context context,final ITemplateHolder template){
  ILockObject templateLock=null;
  try {
    boolean makeWaitForInfo=(template.getExpirationTime() != 0);
    IEntryHolder entry=null;
    try {
      if (makeWaitForInfo)       template.setInitialIfExistSearchActive();
      try {
        entry=_engine.getMatchedEntryAndOperateSA(context,template,makeWaitForInfo,false);
      }
  finally {
        if (makeWaitForInfo)         template.resetInitialIfExistSearchActive();
      }
    }
 catch (    TemplateDeletedException ex) {
      return;
    }
    if (entry != null || template.isDeleted()) {
      return;
    }
    if ((template.getExpirationTime() == 0)) {
      context.setOperationAnswer(template,null,null);
      return;
    }
    if (templateLock == null)     templateLock=getTemplateLockObject(template);
synchronized (templateLock) {
      if (template.hasAnswer())       return;
      if (!template.isHasWaitingFor()) {
        context.setOperationAnswer(template,null,null);
        if (!template.isDeleted() && template.isInCache()) {
          _cacheManager.removeTemplate(context,template,false,true,false);
        }
        return;
      }
    }
  }
 catch (  Exception ex) {
    if (_logger.isLoggable(Level.SEVERE)) {
      _logger.log(Level.SEVERE,"Error handling update.",ex);
    }
    if (templateLock == null)     templateLock=getTemplateLockObject(template);
synchronized (templateLock) {
      if (!template.hasAnswer())       context.setOperationAnswer(template,null,ex);
      if (!template.isDeleted() && template.isInCache())       _cacheManager.removeTemplate(context,template,false,true,false);
    }
  }
 finally {
    if (templateLock != null)     freeTemplateLockObject(templateLock);
  }
}

public void handleDirectUpdateSA ( Context context , final ITemplateHolder template ) { ILockObject templateLock = null ; try { boolean makeWaitForInfo = ( template . getExpirationTime ( ) != 0 ) ; IEntryHolder entry = null ; try { if ( makeWaitForInfo ) template . setInitialIfExistSearchActive ( ) ; try { entry = _engine . getMatchedEntryAndOperateSA ( context , template , makeWaitForInfo , false ) ; } finally { if ( makeWaitForInfo ) template . resetInitialIfExistSearchActive ( ) ; } } catch ( TemplateDeletedException ex ) { return ; } if ( entry != null || template . isDeleted ( ) ) { return ; } if ( ( template . getExpirationTime ( ) == 0 ) ) { context . setOperationAnswer ( template , null , null ) ; return ; } if ( templateLock == null ) templateLock = getTemplateLockObject ( template ) ; synchronized ( templateLock ) { if ( template . hasAnswer ( ) ) return ; if ( ! template . isHasWaitingFor ( ) ) { context . setOperationAnswer ( template , null , null ) ; if ( ! template . isDeleted ( ) && template . isInCache ( ) ) { _cacheManager . removeTemplate ( context , template , false , true , false ) ; } return ; } } } catch ( Exception ex ) { if ( _logger . isLoggable ( Level . SEVERE ) ) { _logger . log ( Level . SEVERE , "Error handling update." , ex ) ; } if ( templateLock == null ) templateLock = getTemplateLockObject ( template ) ; synchronized ( templateLock ) { if ( ! template . hasAnswer ( ) ) context . setOperationAnswer ( template , null , ex ) ; if ( ! template . isDeleted ( ) && template . isInCache ( ) ) _cacheManager . removeTemplate ( context , template , false , true , false ) ; } } finally { if ( templateLock != null ) freeTemplateLockObject ( templateLock ) ; } }
perform update given a template which is the updated entry .
