Exemplo n.º 1
0
  /** Binding version of Cursor.getNext(), join cursor is allowed. */
  OperationStatus getNext(boolean lockForWrite) throws DatabaseException {

    LockMode lockMode = getLockMode(lockForWrite);
    if (joinCursor != null) {
      return joinCursor.getNext(keyThang, valueThang, lockMode);
    } else {
      return cursor.getNext(keyThang, primaryKeyThang, valueThang, lockMode);
    }
  }
Exemplo n.º 2
0
  /** Closes the associated cursor. */
  void close() throws DatabaseException {

    if (joinCursor != null) {
      JoinCursor toClose = joinCursor;
      joinCursor = null;
      toClose.close();
    }
    if (cursor != null) {
      Cursor toClose = cursor.getCursor();
      cursor = null;
      view.currentTxn.closeCursor(toClose);
    }
    if (indexCursorsToClose != null) {
      DataCursor[] toClose = indexCursorsToClose;
      indexCursorsToClose = null;
      for (int i = 0; i < toClose.length; i += 1) {
        toClose[i].close();
      }
    }
  }