01-28-2013 11:00 AM
01-28-2013 02:30 PM
01-29-2013 04:14 AM
/**
* {@link IdGenerator} implementation based on the current time and the ethernet
* address of the machine it is running on.
*
* @author Daniel Meyer
*/
public class StrongUuidGenerator implements IdGenerator {
01-29-2013 05:55 PM
By default Activiti does use a kind of sequence with batches to get ID blocks, but in a db independent way… That two servers get the same block sounds kind of strange and I never heard something like this before.
Isn't there by accident old data in the database and the 'sequence' is reset by accident?
01-29-2013 06:11 PM
There is a property in the ACT_GE_PROPERTY, containing the start of the next "block" of ID's to use, if you're using the default ID-generation strategy. This mechanism will make sure a single engine will use a block of ID's without conflicts, having only one thread allocating a new block. When multiple engines are using the same DB, and they (under heavy load) both fetch a new block at the same time, they will both try to update the 'next.dbid' property in ACT_GE_PROPERTY, one of them should get an ActivitiOptimisticLockException.
If you have duplicate id's, this means this mechanism didn't work as expected, which sounds strange.Can you check if it's a whole block of ID's that are duplicate? Or just a few randomly distributed?
You could also use the StrongUUIDGenerator as id-generator, instead of the DB-approach:
/**
* {@link IdGenerator} implementation based on the current time and the ethernet
* address of the machine it is running on.
*
* @author Daniel Meyer
*/
public class StrongUuidGenerator implements IdGenerator {
01-30-2013 02:25 AM
Is it thread safe?
and how do I set Activiti use StrongUuidGenerator instead of DB-approach?Search the internet: http://bit.ly/116NtOz (hint: read e.g. the ACT-789 at the end)
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.