Class SequenceUpdater.BulkInsertUpdater
- java.lang.Object
-
- org.apache.derby.impl.sql.catalog.SequenceUpdater
-
- org.apache.derby.impl.sql.catalog.SequenceUpdater.BulkInsertUpdater
-
- All Implemented Interfaces:
Cacheable,BulkInsertCounter
- Enclosing class:
- SequenceUpdater
public static final class SequenceUpdater.BulkInsertUpdater extends SequenceUpdater implements BulkInsertCounter
Implementation of SequenceUpdater for use with the bulk-insert optimization used by InsertResultSet. This BulkInsertUpdater doesn't really write to disk. It is assumed that the BulkInsertUpdater will only be used by the bulk-insert code, where the user has exclusive write-access on the table whose identity column is backed by the original SequenceUpdater. At the end of bulk-insert, the current value of the BulkInsertUpdater is written to disk by other code.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.derby.impl.sql.catalog.SequenceUpdater
SequenceUpdater.BulkInsertUpdater, SequenceUpdater.SyssequenceUpdater
-
-
Field Summary
-
Fields inherited from class org.apache.derby.impl.sql.catalog.SequenceUpdater
_dd, _sequenceGenerator, _uuidString
-
-
Constructor Summary
Constructors Constructor Description BulkInsertUpdater()BulkInsertUpdater(SequenceUpdater originalUpdater, boolean restart)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SequenceGeneratorcreateSequenceGenerator(TransactionController readOnlyTC)Initialize the sequence generator.protected booleanupdateCurrentValueOnDisk(TransactionController tc, java.lang.Long oldValue, java.lang.Long newValue, boolean wait)Update the sequence value on disk.-
Methods inherited from class org.apache.derby.impl.sql.catalog.SequenceUpdater
clean, clearIdentity, createIdentity, getBulkInsertUpdater, getCurrentValueAndAdvance, getIdentity, isDirty, makePreallocator, peekAtCurrentValue, reset, setIdentity, updateCurrentValueOnDisk
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.sql.dictionary.BulkInsertCounter
getCurrentValueAndAdvance, peekAtCurrentValue
-
-
-
-
Constructor Detail
-
BulkInsertUpdater
public BulkInsertUpdater()
-
BulkInsertUpdater
public BulkInsertUpdater(SequenceUpdater originalUpdater, boolean restart)
-
-
Method Detail
-
createSequenceGenerator
protected SequenceGenerator createSequenceGenerator(TransactionController readOnlyTC) throws StandardException
Description copied from class:SequenceUpdaterInitialize the sequence generator. Work is done inside a read-only subtransaction of the session's execution transaction.
- Specified by:
createSequenceGeneratorin classSequenceUpdater- Throws:
StandardException
-
updateCurrentValueOnDisk
protected boolean updateCurrentValueOnDisk(TransactionController tc, java.lang.Long oldValue, java.lang.Long newValue, boolean wait) throws StandardException
Description copied from class:SequenceUpdaterUpdate the sequence value on disk. This method does its work in a subtransaction of the user's execution transaction.
- Specified by:
updateCurrentValueOnDiskin classSequenceUpdater- Parameters:
tc- The transaction to useoldValue- Expected value on disk for this sequencenewValue- The value to poke into the system table backing this sequencewait- Whether to wait for a lock- Returns:
- Returns true if the value was successfully updated, false if we lost a race with another session.
- Throws:
StandardException- May throw an exception if a lock can't be obtained.
-
-