Пример #1
0
  /**
   * Close the scan.
   *
   * @see GenericScanController#newRowLocationTemplate
   */
  public void close() throws StandardException {
    super.close();

    if (base_cc_for_locking != null) {
      base_cc_for_locking.close();
      base_cc_for_locking = null;
    }
  }
Пример #2
0
  /**
   * Initialize the scan for use.
   *
   * <p>Any changes to this method may have to be reflected in close as well.
   *
   * <p>The btree init opens the container (super.init), and stores away the state of the
   * qualifiers. The actual searching for the first position is delayed until the first next() call.
   *
   * @exception StandardException Standard exception policy.
   */
  public void init(
      TransactionManager xact_manager,
      Transaction rawtran,
      int open_mode,
      int lock_level,
      LockingPolicy locking_policy,
      int isolation_level,
      boolean open_for_locking,
      FormatableBitSet scanColumnList,
      B2I conglomerate,
      B2IUndo undo)
      throws StandardException {
    // open and lock the base table.

    int base_open_mode = open_mode | TransactionController.OPENMODE_FOR_LOCK_ONLY;

    // open the base conglomerate - just to get lock
    base_cc_for_locking =
        xact_manager.openConglomerate(
            conglomerate.baseConglomerateId, false, base_open_mode, lock_level, isolation_level);

    BTreeLockingPolicy b2i_locking_policy =
        conglomerate.getBtreeLockingPolicy(
            rawtran, lock_level, open_mode, isolation_level, base_cc_for_locking, this);

    super.init(
        xact_manager,
        rawtran,
        false,
        open_mode,
        lock_level,
        b2i_locking_policy,
        scanColumnList,
        (DataValueDescriptor[]) null, // no start position supported
        ScanController.NA, // no start position supported
        (Qualifier[][]) null, // no qualifier supported
        (DataValueDescriptor[]) null, // no stop position supported
        ScanController.NA, // no stop position supported
        conglomerate,
        undo,
        (StaticCompiledOpenConglomInfo) null,
        (DynamicCompiledOpenConglomInfo) null);
  }