04-08-2015 04:19 PM
We use the extension poins "generators" to generate references stored in uid:uid ... Now we have documents that have the same references. After analyzing the creation timestamp, I would say that these are documents created simultaneously ... When I look at the code, I would say it is possible: the last index is read in base, incremented by the code and persisted. If two accesses occur at the same time, it must result in duplicate uid right?
(Obviously, this behavior is a bit problematic for us...)
We use nuxeo 5.8.0-HF30...
04-09-2015 10:24 AM
Yes, UIDSequencer has a flawed implementation that's not thread-safe, which is a problem in many situations. We don't recommend using it anymore.
To generate truly unique sequential ids, we recommend using a SQL directory with <autoincrementIdField>true</autoincrementIdField>
specified, and inserting new entries when needed. Although this makes the directory grow, which may or may not be a problem.
Otherwise use an external mechanism to get incremental ids, like a Hibernate sequence, or a Redis INCR-based counter.
04-09-2015 10:24 AM
Yes, UIDSequencer has a flawed implementation that's not thread-safe, which is a problem in many situations. We don't recommend using it anymore.
To generate truly unique sequential ids, we recommend using a SQL directory with <autoincrementIdField>true</autoincrementIdField>
specified, and inserting new entries when needed. Although this makes the directory grow, which may or may not be a problem.
Otherwise use an external mechanism to get incremental ids, like a Hibernate sequence, or a Redis INCR-based counter.
09-09-2015 11:22 AM
Using SQL directory is not possible in my case, I choose to specialize postgreSQL dialect (add a function to get next value of a sequence with insertion BEFORE return) for nxuidsequencer... It's not easy to test (mandatory postgreSQL) but it works without external tool...
10-02-2020 09:20 AM
Hello,
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.