the DBID_ should be unique so the constraint violation is indeed a problem, the engine should generate the DBID_ the config part in
jbpm4.cfg.xml looks like this:
[...]
<object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator">
<field name="targetExceptionClass"><class class-name="org.hibernate.StaleStateException" /></field>
<field name="commandService"><ref object="newTxRequiredCommandService" /></field>
</object>
<object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
[...]
and I think you are right the problem could be the DbidGenerator generating the same Dbid twice,
as far as i remember i have seen in the source somewhere that it is supposed to find the highest Dbid at bootup time, but not sure about that....