To increase the speed of database inserts, obtain a block of sequence numbers (by setting an allocation size) instead of executing a corresponding SELECT
statement to obtain the newly assigned sequence number each time you create an object.
TopLink uses a default preallocation size of 50 when using a sequence table and 1 when using native sequencing.
INCREMENT
is set on the Oracle Sequence object (not the CACHE
option). This increment must match the pre-allocation size specified in the TopLink Mapping editor. If the increment is set incorrectly, invalid and negative sequence numbers could be generated. The CACHE
option specifies how many sequences are preallocated on the database server; the INCREMENT
specifies the number that can be preallocated to the database client.
Copyright © 1997, 2004, Oracle. All rights reserved.