public CacheMode setCacheMode ( CacheMode cacheMode , FieldList record ) { CacheMode oldCacheMode = this . cacheMode ; this . cacheMode = cacheMode ; if ( ( cacheMode == CacheMode . PASSIVE_CACHE ) && ( oldCacheMode != CacheMode . PASSIVE_CACHE ) ) { // Need to make sure current record is read. m_mapCache = null ; m_htCache = null ; if ( record != null ) { try { if ( record . getEditMode ( ) == Constants . EDIT_CURRENT ) { record . getTable ( ) . setHandle ( record . getCounterField ( ) . getData ( ) , 0 ) ; } if ( record . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) { record . getTable ( ) . setHandle ( record . getCounterField ( ) . getData ( ) , 0 ) ; record . getTable ( ) . edit ( ) ; // Re-read the current record. } } catch ( DBException e ) { e . printStackTrace ( ) ; } } } return oldCacheMode ; }
Change the cache mode