activiti uses DBIdGenerator default, when the id block used up, it will request for another block from db, and increase its
current id status, but I am wondering when will the operation of writing id back to db be performed,
if in the same transaction with other operation like update history identity_link, history_task_instance, what will occur when exception arisen? the id in DbIdGenerator wont rollback, and the new id wont commit to db, so next time it request for new block will result in using the old ids?
what I am missing?
According to Activiti user guide, DbIdGenerator seems to be assumed to have problems.
https://www.activiti.org/userguide/#advanced.uuid.generator
> In some (very) high concurrency load cases, the default id generator may cause exceptions due to not being able to fetch new id blocks quickly enough.
> In (very) limited use cases this can cause problems when there is a real high load.
And, you can use the alternative(the org.activiti.engine.impl.persistence.StrongUuidGenerator)
> which generates a unique UUID locally and uses that as identifier for all entities. Since the UUID is generated without the need for database access, it copes better with very high concurrency use cases.
Or, you can use your original id generator by implementing interface IdGenerator and setting processEngineConfiguration.
not in (very) high concurrency load cases, I mean, not because of high concurrency.
just because the operation of flushing id to db and other operations mix in one transaction,
if some exceptions arisen for business logic error, this will result in id rollback, and the id in DbIdGenerator wont rollback.
Hope this will express myself clear
Sorry for asking a nonexistent question.
DbIdGenerator will use a REQUIRES_NEW propagation commandConfig, the source code is in ProcessEngineConfigurationImpl.
So, why there is a "duplicate key error" happened to activiti, still don't know how this happenes!
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.