We have an entity which has an autonumber column But, recently yesterday, we have been notified that there are duplicate numbers for this autonumber Not sure, how we would have ended up in this, if Mendix could take care of auto numbers. ------------ Additional Details --------------------------- - This ProcessInstance is actually a Generalized entity of multiple specialized entity. - To facilitate dynamic creation of specialized object, we create the ProcessInstance using Java action. - We send the ProcessName, with which the actual process is retrieved and inturn the specialized object of the process. The specialized object name is passed to Java action to create new instance. - The java action uses Core.instantiate(getContext(), CompleteMxObjectType); to create a object - It was working flawlessly without any issue until these days. - As its quite obvious, the attribute with autonumber is never accessible within Mendix to be changed or modified - More problem: The Specialized entity also have its own SequenceNumber, which is also duplicated - It may sound like a result of clone or deepclone, but we are not using those actions
Create a support ticket for this because imho this should not be possible. You can not alter in Mendix the autonumber field. Trying to change that attribute always result in an error. So unless you are doing something inside those Java actions to directly store it in the database (which I think would still generate an error at least in Postgres) there is something really funny going on.
As an afterthought what are the names of the autonumber attributes in those specializations?
Are these objects created in a microflow? If so, can you share the microflow here?
Are you using any of the ORM actions from Community Commons such as clone, deepClone, or copyAttributes on these entities?
Quick check question:
- When we make the column AutoNumber, it is expected to be Unique
- Do we need to set additional Unique validation at the entity level? IMHO, this is not needed, as we expect the AutoNumber is deemed Unique. Any opinions on this?