code: public void checkCacheMode(Boolean boolShouldBeCached)
      {
          try {
              boolean bCurrentlyCached = (this.getRemoteTableType(CachedRemoteTable.class) != null);
              if ((this.getRecord().getOpenMode() & DBConstants.OPEN_CACHE_RECORDS) == DBConstants.OPEN_CACHE_RECORDS)
                  boolShouldBeCached = Boolean.TRUE;
  //            if ((this.getRecord().getOpenMode() & DBConstants.OPEN_READ_ONLY) == DBConstants.OPEN_READ_ONLY);
  //                    bShouldBeCached = true;
              if ((this.getRecord().getOpenMode() & DBConstants.OPEN_DONT_CACHE) == DBConstants.OPEN_DONT_CACHE)
                  boolShouldBeCached = Boolean.FALSE;
              if (boolShouldBeCached == null)
                  return;     // Not specified, Don't change.
              if ((!bCurrentlyCached) && (boolShouldBeCached.booleanValue()))
              {   // Add a cache
                  Utility.getLogger().info("Cache ON: " + this.getRecord().getTableNames(false));
                  this.setRemoteTable(new CachedRemoteTable(m_tableRemote));
              }
              else if ((bCurrentlyCached) && (!boolShouldBeCached.booleanValue()))
              {   // Remove the cache
                  Utility.getLogger().info("Cache OFF: " + this.getRecord().getTableNames(false));
  //                RemoteTable tableRemote = this.getRemoteTableType(org.jbundle.model.Remote.class);
                  RemoteTable tableRemote = this.getRemoteTableType(CachedRemoteTable.class).getRemoteTableType(null);
                  ((CachedRemoteTable)m_tableRemote).setRemoteTable(null);
                  ((CachedRemoteTable)m_tableRemote).free();
                  this.setRemoteTable(tableRemote);
              }
          } catch (RemoteException ex)    {
              // Never for this usage
          }
      }
docs: Make sure the cache is set up correctly for this type of query.
  @param boolShouldBeCached Default cache mode (if null, no default assumed).