feature request #8302open
Assure uniqueness of E+M reference number
The E+M reference number is stored as (alternative) identifier in CDM. Alternative identifiers allow duplicates (e.g. because they might be the empty string or multiple records may refer to the same identifier in general - which is not true for the E+M reference number).
We need a mechanism to assure that the number is unique.
There are multiple solutions:
- Add a "must be unique" flag to IdentifierType to flag those identifier types which must be unique. If the flag is set, there should be a unique check before the data is saved. The problem here is how to check this as we have to check against the complete database. Usually this is done by a unique index in databases. But as not all identifiers must be unique this technique can't be used (a work around could be to use an index on (type, identifer-value, x) where x is always the same value for all identifiers of a unique identifier type. For non-unique identifier types x is an arbitrary but always unique value, e.g. a random uuid).
- During creation of the E+M source number the user could be supported in creating a unique number. E.g. by pressing a button a unique number is created by adding 1 to the current max number. This additionally supports the user in creating the number (currently each user has a block of allowed numbers which is not so comfortable). The only problem is how to check that no 2 users create the same max+1 number before the the first number is saved (see ID generator solutions, e.g. hibernate generators, but they creates unused numbers). Also we need to guarantee that the user is using this creator button.
- other solution
Also needs discussion how severe this issue is. If numbers are only used for fast searching references, the duplication problem will soon be recognized once you search and get 2 results.
This is both a taxeditor and a cdmlib/cdm issue.
Updated by Andreas Müller almost 3 years ago
zur Nummernvergabe: jeder Editor hatte ursprünglich einen ausreichenden Slot von Nummern, die er konsekutiv vergeben hat. Ich selbst notiere mir immer die letzten Nummern, die ich vergeben habe, damit ich weiß, wo ich weitermachen kann. Oder ich suche tatsächlich in der Datenbank danach. Automatisieren- warum nicht? Hauptsache, Dopplungen werden vermieden. Hatten wir manchmal, wenn Editoren aus Versehen identische Nummern vergeben hatten, ohne es zu merken.