docs: public void doTimeBasedWrites(boolean forceWrite) {
          //create local variable - JIT performance improvement
          final boolean isTraceOn = com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
              LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[DO_TIME_BASED_WRITES]);
          }
  
          BackedSession cachedSession;
          Object currentKey;
  
          if (forceWrite) {
              if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                  LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES], "Entered for forceWrite request");
              }
          }
  
          long now = System.currentTimeMillis();
          long writeInterval = _smc.getPropertyWriterInterval() * 1000; //convert seconds to milliseconds
  
          Enumeration vEnum = tableKeys();
          if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
              LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES], "!!!!!!!!!!PropertyWriteThread Loop STARTS Here!!!!!!!!!!!!! ");
          }
          while (vEnum.hasMoreElements()) {
              //LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodName, "Look at next Cache Element");
              currentKey = (Object) vEnum.nextElement();
              cachedSession = (BackedSession) super.get(currentKey);
              if (cachedSession != null) {
                  //LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodName, "Cache element NOT NULL");
  
                  long lastWrite = cachedSession.getLastWriteTime();
                  long lastAccess = cachedSession.getCurrentAccessTime();
  
                  //  English Translation for the test below:
                  //
                  //    If lastWrite is -1
                  //       then the session must have just been read into
                  //       the cache... Don't know when the lastWrite was or
                  //       if something has changed since the read.. Therefore
                  //       do the write.  This shouldn't happen often.
                  //
                  //    If the Write Interval has elapsed and the session has been
                  //       changed then do the write. This should be the normal case.
                  //
  
                  if ((lastWrite == -1) || ((((now - lastWrite) > writeInterval) || forceWrite) && (lastAccess > lastWrite))) {
  
                      /*
                       * commented out in old code
                       * // LoggingUtil.SESSION_LOGGER_WAS.debug(SessionContext.tc, SessionConstants.doTimeBasedWrites + " Passed test... consider doing the write");
                       * end of commented out code
                       */
  
                      // Hold synchronized lock while we check if this session is
                      // executing in the servlet service method.  New request threads
                      // for this session will call the incrementInServiceMethodCount()
                      // method.  That method also does a "synchronized" on the session
                      // object, therefore guaranteeing that no new requests will update the
                      // session object until this write completes.
  
                      synchronized (cachedSession) {
  
                          //  Now that we have the session Object locked, check that the
                          //  session is still valid.  It is possible that the servlet
                          //  called the session.invalidate() method under a different
                          //  thread after we got the keys from the cache.  Since
                          //  sessionData.invalidate() does a sync on the session, it is now
                          //  safe to check...
                          //
                          //  Also, account for the case where the session was aged out
                          //  of the cache after we got the keys above...
  
                          //  We will never get here for a Timed Out invalidation since
                          //  the Invalidation time must be at least twice the Write Interval
                          //  and the write will always be done before an invalidation condition
                          //  can occur.
  
                          //cachedSession = (DatabaseSessionData) ((BackedHashtable) mSessions).superGet(currentKey);
  
                          if (cachedSession.isValid()) {
                              String id = cachedSession.getId();
                              //if the refCount!=0, it is still active in the service method
                              if (cachedSession.getRefCount() != 0) {
                                  // skip the entry.. The next time this thread runs
                                  // it will get tried again...
                                  cachedSession.deferWriteUntilNextTick++;
                                  if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                      LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES],
                                                                          "Defer write until next time since session is in the service method "
                                                                                          + cachedSession.deferWriteUntilNextTick + " " + id);
                                  }
                                  // Failed to write on 5 tries. Force the write to database!!
                                  if (cachedSession.deferWriteUntilNextTick > 5) {
                                      if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                          LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES],
                                                                              "Failed to write on 5 tries. Force the write to database!! " + " " + id);
                                      }
                                      cachedSession.setLastWriteTime(now);
                                      // cachedSession.sync();
                                      cachedSession.flush();
                                      cachedSession.deferWriteUntilNextTick = 0;
                                  }
                              } else {
                                  if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                      LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES],
                                                                          "Do the session Write and update lastWriteTime " + id);
                                  }
  
                                  // It is important to note that lastWriteTime is being
                                  // updated to the current time (now), though lastAccess may
                                  // contain a value up to Now-WriteInterval.  After this
                                  // write completes it is possible that the Session is
                                  // used again.  The Write of LastAccess will not take
                                  // place again until WriteInterval elapses again.  So, in order
                                  // for this session not to be inadvertently invalidated
                                  // by a different clone, it is necessary that the invalidation
                                  // time be AT LEAST 2 TIMES the WriteInterval.  This should
                                  // be enforced in the GUI.
  
                                  cachedSession.setLastWriteTime(now);
                                  cachedSession.flush(); // do the write
                                  cachedSession.deferWriteUntilNextTick = 0;
                              }
                          } else {
                              if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                  LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES], "Session no longer in Cache!");
                              }
                          }
                      } //end of synchronized
                  } else {
                      //Database Write did NOT occur
                      //LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodName, "Database Write did NOT occur!");
                  }
              } else {
                  if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                      LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES], "The Cache element is NULL");
                  }
              }
          }
          if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
              LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[DO_TIME_BASED_WRITES], "!!!!!!!!!! PropertyWriteThread Loop ENDS Here!!!!!!!!!!!!!");
          }
      }