docs: public void open(String strKeyArea, int iOpenMode, boolean bDirection, String strFields, Object objInitialKey, Object objEndKey, byte[] byBehaviorData) throws DBException, RemoteException
      {
          try   {
              synchronized (this.getTask())
              {   // In case two tasks are calling here
                  this.getMainRecord().close();
  
          // FROM is automatic, since the remote BaseRecord is exactly the same as this one
          // ORDER BY
                  KeyArea keyArea =  this.getMainRecord().getKeyArea();
                  if (strKeyArea != null)
                  {
                      this.getMainRecord().setKeyArea(strKeyArea);
                      keyArea = this.getMainRecord().getKeyArea(-1);
                      // This next set of code deals with a special case where the caller wants a non-key area order
                      if (this.getMainRecord().getDefaultOrder() == Constants.MAIN_KEY_AREA)
                          if (!keyArea.getKeyName().equals(strKeyArea))
                              if (!Constants.PRIMARY_KEY.equals(strKeyArea))
                      {
                          BaseField field = this.getMainRecord().getField(strKeyArea);
                          if (field != null)
                          {
                              KeyArea tempKeyStart = this.getMainRecord().makeIndex(DBConstants.NOT_UNIQUE, null);  // Add temp key
                              tempKeyStart.addKeyField(field, bDirection);
                              this.getMainRecord().setKeyArea(this.getMainRecord().getKeyAreaCount() - 1);
                          }
                      }
                      keyArea.setKeyOrder(bDirection);
                  }
          // Open mode
                  this.getMainRecord().setOpenMode(iOpenMode);
          // SELECT (fields to select)
                  if (strFields != null)
                      this.getMainRecord().setSelected(strFields);    // Select these fields
                  else
                  {
                      Record recordBase = this.getMainRecord().getTable().getCurrentTable().getRecord();
                      int iFieldTypes = this.getFieldTypes(recordBase);
                      if (iFieldTypes == BaseBuffer.PHYSICAL_FIELDS)
                          this.getMainRecord().setSelected(true);   // Select these fields (otherwise leave the selection alone)
                  }
          // WHERE XYZ >=
                  FileListener listener = null;
                  listener = (FileListener)this.getMainRecord().getListener();
                  while (listener != null)
                  {   // Clear inited flag from all Linked behaviors
                      if ((listener.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0)
                          listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() & ~FileListener.INITED_IN_SLAVE);    // Clear inited flag
                      listener = (FileListener)listener.getNextListener();
                  }
                  if (objInitialKey != null)
                  {
                      VectorBuffer recBuff = new VectorBuffer((Vector)objInitialKey);
                      int iLastModified = -1;
                      keyArea.reverseKeyBuffer(recBuff, DBConstants.FILE_KEY_AREA);
                      String strLastModified = recBuff.getNextString();
                      try {
                          if (strLastModified != null)
                              iLastModified = Integer.parseInt(strLastModified);
                      } catch (NumberFormatException ex)  {
                          iLastModified = -1;
                      }
                      this.getMainRecord().addListener(listener = new SubCurrentFilter(iLastModified, true, false));   // Use current
                      listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE | FileListener.RUN_IN_SLAVE);
                  }
          // WHERE XYZ >=
                  if (objEndKey != null)
                  {
                      VectorBuffer recBuff = new VectorBuffer((Vector)objEndKey);
                      keyArea.reverseKeyBuffer(recBuff, DBConstants.FILE_KEY_AREA);
                      int iLastModified = -1;
                      String strLastModified = recBuff.getNextString();
                      try {
                          if (strLastModified != null)
                              iLastModified = Integer.parseInt(strLastModified);
                      } catch (NumberFormatException ex)  {
                          iLastModified = -1;
                      }
                      this.getMainRecord().addListener(listener = new SubCurrentFilter(iLastModified, false, true));   // Use current
                      listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE | FileListener.RUN_IN_SLAVE);
                  }
          // WHERE XYZ
          // The following code replicates the Behaviors for the server class.
          // If the listener doesn't exist, it is created and the current params are set.
          // If the listener does exist, the current params are set.
          // Note: There is a special section of code to see that if two behaviors with the same
          // name exist, they are set separately.
                  if (byBehaviorData != null)
                  {
                      ByteArrayInputStream baIn = new ByteArrayInputStream(byBehaviorData);
                      ObjectInputStream daIn = new ObjectInputStream(baIn);
                      String strBehaviorName = null;
                      try   {
                              strBehaviorName = daIn.readUTF();
                          } catch (IOException ex)    {
                              strBehaviorName = null;
                          }
                      while (strBehaviorName != null)
                      {
                          listener = (FileListener)this.getMainRecord().getListener(strBehaviorName);
                          while (listener != null)
                          {   // Already set up this listener, find the next one or null
                              if ((listener.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0)
                                  if ((listener.getMasterSlaveFlag() & FileListener.INITED_IN_SLAVE) == 0)
                                      break;      // Use this listener (Linked, but not inited)
                              listener = (FileListener)listener.getListener(strBehaviorName);
                          }
                          if (listener == null)
                          {
                          	listener = (FileListener)ClassServiceUtility.getClassService().makeObjectFromClassName(strBehaviorName);
                          }
                          else
                          {
                              this.getMainRecord().removeListener(listener, false);
                          }
                          listener.initRemoteSkel(daIn);
                          this.getMainRecord().addListener(listener);
                          listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE);
                          try   {
                              strBehaviorName = daIn.readUTF();
                          } catch (IOException ex)    {
                              strBehaviorName = null;
                          }
                      }
                      daIn.close();
                      baIn.close();
                  }
                  listener = (FileListener)this.getMainRecord().getListener();
                  while (listener != null)
                  {   // Remove old created behaviors (linked, but not inited)
                      FileListener behaviorToRemove = listener;
                      listener = (FileListener)listener.getNextListener();
                      if ((behaviorToRemove.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0)
                          if ((behaviorToRemove.getMasterSlaveFlag() & FileListener.INITED_IN_SLAVE) == 0)
                              this.getMainRecord().removeListener(behaviorToRemove, true);
                  }
          // End
                  Utility.getLogger().info("EJB Open key: " + strKeyArea);
                  this.getMainRecord().open();
              }
          } catch (DBException ex)    {
              throw ex;
          } catch (Exception ex)  {
              ex.printStackTrace();
              throw new DBException(ex.getMessage());
          }
      }