Apache Derby 10.9

org.apache.derby.catalog
Interface SequencePreallocator


public interface SequencePreallocator

Logic to determine how many values to pre-allocate for a sequence. By default, Derby boosts concurrency by pre-allocating ranges of numbers for sequences. During orderly database shutdown, the unused numbers are reclaimed so that shutdown will not create holes in the sequences. However, holes may appear if the application fails to shut down its databases before the JVM exits.

Logic in this class is called every time Derby needs to pre-allocate a new range of sequence values. Users can override Derby's default behavior by writing their own implementation of this interface and then setting the following Derby property:

  -Dderby.language.sequence.preallocator=com.acme.MySequencePreallocator
 

Classes which implement this interface must also provide a public 0-arg constructor so that Derby can instantiate them. Derby will instantiate a SequencePreallocator for every sequence.


Method Summary
 int nextRangeSize(java.lang.String schemaName, java.lang.String sequenceName)
           This method returns the size of the next pre-allocated range for the specified sequence.
 

Method Detail

nextRangeSize

int nextRangeSize(java.lang.String schemaName,
                  java.lang.String sequenceName)

This method returns the size of the next pre-allocated range for the specified sequence. Names are case-sensitive, as specified in CREATE SEQUENCE and CREATE TABLE statements.

Parameters:
schemaName - Name of schema holding the sequence.
sequenceName - Specific name of the sequence.

Built on Thu 2012-05-31 12:19:36-0700, from revision 1344872

Apache Derby 10.9 API Documentation - Copyright © 2004,2012 The Apache Software Foundation. All Rights Reserved.