Package net.ontopia.persistence.proxy
Class HighLowKeyGenerator
java.lang.Object
net.ontopia.persistence.proxy.HighLowKeyGenerator
- All Implemented Interfaces:
KeyGeneratorIF
INTERNAL: A key generator using the HIGH/LOW key generator
algorithm. It maintains the current counters in a counter
table. The key generator is able to preallocate a number of
identities which it hand out without having to go the database for
every new identity needed. It is used by the RDBMS proxy
implementation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHighLowKeyGenerator(ConnectionFactoryIF connfactory, String table, String keycol, String valcol, String global_entry, int grabsize, String database, Map<String, String> properties) -
Method Summary
Modifier and TypeMethodDescriptiongenerateKey(Class<?> type) INTERNAL: Generates a new object identity of the specified object type.protected longincrementInDatabase(Object type) INTERNAL: Sends a request to the database to retrieve the current counter value.
-
Field Details
-
connfactory
-
table
-
keycol
-
valcol
-
grabsize
protected int grabsize -
global_entry
-
database
-
properties
-
value
protected long value -
max_value
protected long max_value
-
-
Constructor Details
-
HighLowKeyGenerator
-
-
Method Details
-
generateKey
Description copied from interface:KeyGeneratorIFINTERNAL: Generates a new object identity of the specified object type.- Specified by:
generateKeyin interfaceKeyGeneratorIF
-
incrementInDatabase
INTERNAL: Sends a request to the database to retrieve the current counter value. The counter value row is then locked, the counter incremented and the new value stored.
-