| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.persistence.db
|
Class PooledOracleUidGenerator
|
public class PooledOracleUidGenerator
Thread-safe, pooling oracle uid generator.
Uses a mixed sequence/cache mechanism, mapping
sequences to a backing cache of integers
that synchronize at a rate prescribed by the
db sequence increment.
Changing the sequence increment during the lifecycle
of this generator will have adverse effects to the generation
of unique keys.
It is recommended that you only use
a single PooledOracleUidGenerator for the lifetime
of the application.
Initialization is generally the most expensive process.
Secondly the backing cache is not shared by different
pooled instances, therefore gaps may appear for an
application that is retrieving from the same logical
sequence, the actual database sequence, mapped by
the uidName in the method getNextUniqueId and
getCurrentUniqueId.
TODO: possibly improve concurrency access.
Author:
msimonsen
Implements:
UniqueIdGenerator
Links:
Implementation Implementation Link
Thread-safe, pooling oracle uid generator.
Uses a mixed sequence/cache mechanism, mapping
sequences to a backing cache of integers
that synchronize at a rate prescribed by the
db sequence increment.
Changing the sequence increment during the lifecycle
of this generator will have adverse effects to the generation
of unique keys.
It is recommended that you only use
a single PooledOracleUidGenerator for the lifetime
of the application.
Initialization is generally the most expensive process.
Secondly the backing cache is not shared by different
pooled instances, therefore gaps may appear for an
application that is retrieving from the same logical
sequence, the actual database sequence, mapped by
the uidName in the method getNextUniqueId and
getCurrentUniqueId.
TODO: possibly improve concurrency access.
Author:
msimonsen
| Field Summary |
private ReentrantLock |
|
private HashMap |
|
| Constructor Summary |
public void |
|
| Method Summary |
public int |
|
public int |
|
private ReentrantLock lock
Multiplicity:
1
private HashMap pooledGenerator
Multiplicity:
1
public void PooledOracleUidGenerator ()
Stereotype:
create
public int getCurrentUniqueId (String uidName, Transaction transaction)
Throws:
PersistenceException
public int getNextUniqueId (String uidName, Transaction transaction)
Throws:
PersistenceException
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|