Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.sequencing
Interface SequencingControl

public interface SequencingControl

Purpose: Define an interface to control sequencing functionality.

Description: This interface is accessed through DatabaseSession.getSequencingControl(). It allows to create, re-create, customize Sequencing object which is available through DatabaseSession.getSequencing() and provides sequencing values for all descriptors that use sequencing. Here's the lifecycle of Sequencing object used by DatabaseSession: 1. DatabaseSession created - sequencing object doesn't yet exist; 2. DatabaseSession.login() causes creation of Sequencing object; 3. DatabaseSession.logout() causes destruction of Sequencing object. In case sequencing object doesn't yet exist all the set parameters' values will be used during its creation. In case sequencing object already exists: 1. The following methods don't alter sequencing object - the corresponding parameters will only be used in case a new sequencing object is created: setShouldUseSeparateConnection; setLogin; setMinPoolSize; setMaxPoolSize. 2. The following methods cause immediate destruction of the sequencing object and creation of a new one: setValueGenerationPolicy; setShouldUseNativeSequencing; setShouldUseTableSequencing; resetSequencing; 3. The following methods cause change immediately: setPreallocationSize (next sequencing preallocation will use the set parameter's value).

Responsibilities:

- Define the APIs for controlling sequencing.

See Also:
  `Sequence`, `DatabaseSession`

Method Summary
`Login` | `getLogin()` ADVANCED: Return a DatabaseLogin to be used by separate sequencing connection(s).
`int` | `getMaxPoolSize()` PUBLIC: Returns a maximum number of connections in sequencing connection pool
`int` | `getMinPoolSize()` PUBLIC: Returns a minimum number of connections in sequencing connection pool.
`int` | `getPreallocationSize()` PUBLIC: Returns a number of new sequencing objects to be obtained at a time.
`void` | `initializePreallocated()` ADVANCED: Removes all preallocated sequencing objects.
`void` | `initializePreallocated(java.lang.String seqName)` ADVANCED: Removes all preallocated sequencing objects for the given sequence name.
`boolean` | `isConnectedUsingSeparateConnection()` PUBLIC: Indicates whether sequencing actually uses separate connection(s).
`void` | `resetSequencing()` ADVANCED: Immediately re-create sequencing object.
`void` | `setLogin(Login login)` ADVANCED: Returns a DatabaseLogin to be used by separate sequencing connection(s) The set value is ignored if shouldUseSeparateConnection() returns false.
`void` | `setMaxPoolSize(int size)` PUBLIC: Sets a maximum number of connections in sequencing connection pool The set value is ignored if shouldUseSeparateConnection() returns false.
`void` | `setMinPoolSize(int size)` PUBLIC: Sets a minimum number of connections in sequencing connection pool The set value is ignored if shouldUseSeparateConnection() returns false.
`void` | `setPreallocationSize(int size)` PUBLIC: Sets a number of new sequencing objects to be obtained at a time.
`void` | `setShouldUseSeparateConnection(boolean shouldUseSeparateConnection)` PUBLIC: Set whether separate connection(s) for sequencing could be used (by default it couldn't).
`void` | `shouldUseNativeSequencing()` OBSOLETE: In case native sequencing is not already used, switches to native sequencing.
`boolean` | `shouldUseSeparateConnection()` PUBLIC: Indicate whether separate connection(s) for sequencing could be used (by default it couldn't).
`void` | `shouldUseTableSequencing()` OBSOLETE: In case table sequencing is not already used, switches to table sequencing.
`boolean` | `usesCustomSequencing()` OBSOLETE: Indicate whether custom sequencing is used: neither native nor table.
`boolean` | `usesNativeSequencing()` OBSOLETE: Indicate whether native sequencing is used.
`boolean` | `usesTableSequencing()` OBSOLETE: Indicate whether table sequencing is used

Method Detail

### resetSequencing

    public void resetSequencing()

  ADVANCED: Immediately re-create sequencing object. The only reason to use this method is to pick up all parameters' values that were changed after the original sequencing object has been created.

### shouldUseNativeSequencing

    public void shouldUseNativeSequencing()

  OBSOLETE: In case native sequencing is not already used, switches to native sequencing.

### usesNativeSequencing

    public boolean usesNativeSequencing()

  OBSOLETE: Indicate whether native sequencing is used.

### shouldUseTableSequencing

    public void shouldUseTableSequencing()

  OBSOLETE: In case table sequencing is not already used, switches to table sequencing.

### usesTableSequencing

    public boolean usesTableSequencing()

  OBSOLETE: Indicate whether table sequencing is used

### usesCustomSequencing

    public boolean usesCustomSequencing()

  OBSOLETE: Indicate whether custom sequencing is used: neither native nor table.

### shouldUseSeparateConnection

    public boolean shouldUseSeparateConnection()

  PUBLIC: Indicate whether separate connection(s) for sequencing could be used (by default it couldn't). If this flag is set to true then separate connection(s) for sequencing will be used in case getSequence().shouldUseSeparateConnection() returns true.
  See Also:
    `Sequence`

### setShouldUseSeparateConnection

    public void setShouldUseSeparateConnection(boolean shouldUseSeparateConnection)

  PUBLIC: Set whether separate connection(s) for sequencing could be used (by default it couldn't). If this flag is set to true then separate connection(s) for sequencing will be used in case getSequence().shouldUseSeparateConnection() returns true.
  See Also:
    `Sequence`

### isConnectedUsingSeparateConnection

    public boolean isConnectedUsingSeparateConnection()

  PUBLIC: Indicates whether sequencing actually uses separate connection(s). Returns true if sequencing is connected and uses separate connection(s). Returns false if sequencing is not connected (getSequencing()==null). Note that if shouldUseSeparateConnection() returns false this method also returns false. However if shouldUseSeparateConnection() returns true this method returns false in the following two cases: sequencing is not connected; getSequence().shouldUseSeparateConnection() == false.
  See Also:
    `Sequence`

### getLogin

    public Login getLogin()

  ADVANCED: Return a DatabaseLogin to be used by separate sequencing connection(s).
  See Also:
    `DatabaseLogin`

### setLogin

    public void setLogin(Login login)

  ADVANCED: Returns a DatabaseLogin to be used by separate sequencing connection(s) The set value is ignored if shouldUseSeparateConnection() returns false. The DatabaseLogin *MUST*: 1. specify *NON-JTS* connections (such as NON_JTS driver or read-only datasource); 2. sequenceLogin.shouldUseExternalTransactionController()==false In case this method is not called, but separate connection should be used, sequencing will use a clone of login owned by the DatabaseSession, or a clone of read login owned by ServerSession.
  See Also:
    `DatabaseLogin`

### getMinPoolSize

    public int getMinPoolSize()

  PUBLIC: Returns a minimum number of connections in sequencing connection pool.
  See Also:
    `ConnectionPool`, `ServerSession`

### setMinPoolSize

    public void setMinPoolSize(int size)

  PUBLIC: Sets a minimum number of connections in sequencing connection pool The set value is ignored if shouldUseSeparateConnection() returns false. The set value is ignored if SequencingControl has been obtained not from ServerSession. By default is 2.
  See Also:
    `ConnectionPool`, `ServerSession`

### getMaxPoolSize

    public int getMaxPoolSize()

  PUBLIC: Returns a maximum number of connections in sequencing connection pool
  See Also:
    `ConnectionPool`, `ServerSession`

### setMaxPoolSize

    public void setMaxPoolSize(int size)

  PUBLIC: Sets a maximum number of connections in sequencing connection pool The set value is ignored if shouldUseSeparateConnection() returns false. The set value is ignored if SequencingControl has been obtained not from ServerSession. By default is 2.
  See Also:
    `ConnectionPool`, `ServerSession`

### getPreallocationSize

    public int getPreallocationSize()

  PUBLIC: Returns a number of new sequencing objects to be obtained at a time.
  See Also:
    `Sequence`

### setPreallocationSize

    public void setPreallocationSize(int size)

  PUBLIC: Sets a number of new sequencing objects to be obtained at a time. The set value is ignored if getSequencingValueGenarationPolicy().shouldUsePreallocation() returns false. Default value is set in the project (sequencing preallocation size).
  See Also:
    `Sequence`

### initializePreallocated

    public void initializePreallocated()

  ADVANCED: Removes all preallocated sequencing objects. Ignored if getSequencingValueGenarationPolicy().shouldUsePreallocation() returns false. This method is called internally after Sequencing object is destructed.
  See Also:
    `Sequence`

### initializePreallocated

    public void initializePreallocated(java.lang.String seqName)

  ADVANCED: Removes all preallocated sequencing objects for the given sequence name. Ignored if getSequencingValueGenarationPolicy().shouldUsePreallocation() returns false.
  See Also:
    `Sequence`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD