SCursorConfig (Oracle - Berkeley DB Client-Server API)
Date: 2018-05-29

com.sleepycat.client

## Class SCursorConfig

- java.lang.Object
- - com.sleepycat.client.SCursorConfig

-     public class SCursorConfig
      extends java.lang.Object

  Specify the attributes of database cursor.

  For a user created instance, no attribute is set by default. In addition, calling the getter method of an unset attribute results in an IllegalStateException. To set an attribute, call the setter method of the attribute.

  When used to create a cursor, system default values are used for unset attributes.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SCursorConfig` | `DEFAULT` Default configuration used if null is passed to methods that create a cursor.
    `static SCursorConfig` | `READ_COMMITTED` A convenience instance to configure a cursor for read committed isolation.
    `static SCursorConfig` | `READ_UNCOMMITTED` A convenience instance to configure read operations performed by the cursor to return modified but not yet committed data.
    `static SCursorConfig` | `SNAPSHOT` A convenience instance to configure read operations performed by the cursor to return values as they were when the cursor was opened, if `SDatabaseConfig.setMultiversion(boolean)` is configured.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SCursorConfig()` Create an empty SCursorConfig with no attribute set.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getBulkCursor()` Return if the cursor will be used to do bulk operations on the underlying database.
    `protected java.lang.Object` | `getField(F field)` Return the value set on a specified field.
    `boolean` | `getReadCommitted()` Return if the cursor is configured for read committed isolation.
    `boolean` | `getReadUncommitted()` Return if read operations performed by the cursor are configured to return modified but not yet committed data.
    `boolean` | `getSnapshot()` Return if read operations performed by the cursor are configured to return data as it was when the cursor was opened, without locking.
    `protected T` | `getThriftObj()`
    `SCursorConfig` | `setBulkCursor(boolean bulkCursor)` Specify that the cursor will be used to do bulk operations on the underlying database.
    `SCursorConfig` | `setReadCommitted(boolean readCommitted)` Configure the cursor for read committed isolation.
    `SCursorConfig` | `setReadUncommitted(boolean readUncommitted)` Configure read operations performed by the cursor to return modified but not yet committed data.
    `SCursorConfig` | `setSnapshot(boolean snapshot)` Configure read operations performed by the cursor to return data as it was when the cursor opened without locking, if `SDatabaseConfig.setMultiversion(boolean)` was configured.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT

          public static final SCursorConfig DEFAULT

      Default configuration used if null is passed to methods that create a cursor.

    - #### READ_COMMITTED

          public static final SCursorConfig READ_COMMITTED

      A convenience instance to configure a cursor for read committed isolation.

      This ensures the stability of the current data item read by the cursor but permits data read by this cursor to be modified or deleted prior to the commit of the transaction.

    - #### READ_UNCOMMITTED

          public static final SCursorConfig READ_UNCOMMITTED

      A convenience instance to configure read operations performed by the cursor to return modified but not yet committed data.

    - #### SNAPSHOT

          public static final SCursorConfig SNAPSHOT

      A convenience instance to configure read operations performed by the cursor to return values as they were when the cursor was opened, if `SDatabaseConfig.setMultiversion(boolean)` is configured.

  - ### Constructor Detail

    - #### SCursorConfig

          public SCursorConfig()

      Create an empty SCursorConfig with no attribute set.

  - ### Method Detail

    - #### getBulkCursor

          public boolean getBulkCursor()

      Return if the cursor will be used to do bulk operations on the underlying database.
      Returns:
        if the cursor will be used to do bulk operations on the underlying database

    - #### setBulkCursor

          public SCursorConfig setBulkCursor(boolean bulkCursor)

      Specify that the cursor will be used to do bulk operations on the underlying database.
      Parameters:
        `bulkCursor` - if true, specify the cursor will be used to do bulk operations on the underlying database
      Returns:
        this

    - #### getReadCommitted

          public boolean getReadCommitted()

      Return if the cursor is configured for read committed isolation.
      Returns:
        if the cursor is configured for read committed isolation

    - #### setReadCommitted

          public SCursorConfig setReadCommitted(boolean readCommitted)

      Configure the cursor for read committed isolation.

      This ensures the stability of the current data item read by the cursor but permits data read by this cursor to be modified or deleted prior to the commit of the transaction.

      Parameters:
        `readCommitted` - if true, configure the cursor for read committed isolation
      Returns:
        this

    - #### getReadUncommitted

          public boolean getReadUncommitted()

      Return if read operations performed by the cursor are configured to return modified but not yet committed data.
      Returns:
        if read operations performed by the cursor are configured to return modified but not yet committed data

    - #### setReadUncommitted

          public SCursorConfig setReadUncommitted(boolean readUncommitted)

      Configure read operations performed by the cursor to return modified but not yet committed data.
      Parameters:
        `readUncommitted` - if true, configure read operations performed by the cursor to return modified but not yet committed data
      Returns:
        this

    - #### getSnapshot

          public boolean getSnapshot()

      Return if read operations performed by the cursor are configured to return data as it was when the cursor was opened, without locking.
      Returns:
        if read operations performed by the cursor are configured to return data as it was when the cursor was opened, without locking

    - #### setSnapshot

          public SCursorConfig setSnapshot(boolean snapshot)

      Configure read operations performed by the cursor to return data as it was when the cursor opened without locking, if `SDatabaseConfig.setMultiversion(boolean)` was configured.
      Parameters:
        `snapshot` - if true, configure read operations performed by the cursor to return data as it was when the cursor was opened, without locking
      Returns:
        this

    - #### getThriftObj

          protected T getThriftObj()

    - #### getField

          protected java.lang.Object getField(F field)
                                       throws java.lang.IllegalStateException

      Return the value set on a specified field. Throw IllegalStateException if the field is not set.
      Parameters:
        `field` - the field
      Returns:
        the field's value
      Throws:
        `java.lang.IllegalStateException` - if the field is not set

Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.