After looking into jBPM source code I get a concrete impression that there should not be two jbpm4_variable (Variable and class hierarchy) that share the same Lob. The Lob constructors take care (because generateDbId is true) of assigning a new id to the record.
My best guess is something with the DatabaseDbIdGenerator but looking into the source code I have found nothing strange. More, the LOB_ that are duplicated as FK in jbpm4_variable table seem unrelated:
1970117,
1970123,
1970218,
2260229,
2260232
So a guess on edge cases, boundaries of block size, is off by now. I put a little test with two JVM for concurrency but the block generation is done inside a transaction and the behavior seems correct. One JVM fails but it is on a cycle of attempts and it peeks the next available block.
Any ideas from the people that coded jBPM, maybe I am missing something.
-- Jorge