@Override protected void complete(){
  super.complete();
  try {
    if (_dirty || (_data.getAccessed() - _data.getLastSaved()) >= (_savePeriodMs)) {
      _data.setLastSaved(System.currentTimeMillis());
      willPassivate();
      update(_data);
      didActivate();
      if (Log.isDebugEnabled())       Log.debug("Dirty=" + _dirty + ", accessed-saved="+ _data.getAccessed()+ "-"+ _data.getLastSaved()+ ", savePeriodMs="+ _savePeriodMs);
    }
  }
 catch (  Exception e) {
    Log.warn("Problem persisting changed session data id=" + getId(),e);
  }
 finally {
    _dirty=false;
  }
}

@ Override protected void complete ( ) { super . complete ( ) ; try { if ( _dirty || ( _data . getAccessed ( ) - _data . getLastSaved ( ) ) >= ( _savePeriodMs ) ) { _data . setLastSaved ( System . currentTimeMillis ( ) ) ; willPassivate ( ) ; update ( _data ) ; didActivate ( ) ; if ( Log . isDebugEnabled ( ) ) Log . debug ( "Dirty=" + _dirty + ", accessed-saved=" + _data . getAccessed ( ) + "-" + _data . getLastSaved ( ) + ", savePeriodMs=" + _savePeriodMs ) ; } } catch ( Exception e ) { Log . warn ( "Problem persisting changed session data id=" + getId ( ) , e ) ; } finally { _dirty = false ; } }
exit from session if the session attributes changed then always write the session to the cloud . if just the session access time changed , we don ' t always write out the session , because the gigaspace will serialize the unchanged session attributes . to save on serialization overheads , we only write out the session when only the access time has changed if the time at which we last saved the session exceeds the chosen save interval .
