-
Task
-
Resolution: Done
-
Critical
-
None
-
None
-
None
mechanism:
1) add JBPM4_PROPERTIES table (See also JBPM-2527)
2) define a property called NEXTID with a long value that is initialized at 1
3) define a KeyGeneratorImpl in the process-engine context, with eager initialization
4) make sure that all hibernate entities during construction get a value from the id generator
- each id generator will acquire a block of ids by updating the NEXTID property
- block acquisition is guarded with optimistic locking
- ids will be consumed from the block (very fast, without db access)
5) remove all the explicit flushes
6) implement a DefaultKeyGenerator that only uses in memory key generation in case people work without persistence
public abstract class KeyGenerator {
// similar as ScriptManager
public static KeyGenerator getKeyGenerator()
// similar as ScriptManager
public static KeyGenerator getDefaultKeyGenerator() {...}
public long getNextId()
{...}}
Motivations:
1) database portability : see also JBPM-2510
2) performance
JBPM-2510
- is related to
-
JBPM-2527 introduce schema version property
- Resolved