Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2526

implement jbpm key generation

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Critical Critical
    • jBPM 4.2
    • 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

              tom.baeyens Tom Baeyens (Inactive)
              tom.baeyens Tom Baeyens (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 week
                  1w
                  Remaining:
                  Remaining Estimate - 1 week
                  1w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified