The flow is: OC_IsTeethCareTicked, The role is SupportWorker.
The problem is: Duplicate column value violates its unique constraint: ERROR: duplicate key value violates unique constraint "dailysupportrecord$personalcare_pkey"
Check at what time 10977524092907448 got created. Probably not long before this error-message.
The time is in the afternoon. More often then in the morning I guess? You got your supportworkers working on the same person-dossiers?
Solution might be to change the start of this process by replacing a Create by a FetchOrCreate.
Another possibility: someone is doubleclicking save-button. In that case: set that button’s microflow call to property ‘Disable during action’ to yes.
The commit is probably done twice at the same time. Check if there is a button that calls DailySupportRecord.OC_IsTeethCareTicked and try to reproduce the issue by double clicking. If so, set disabled during action. If it’s caused by double clicking a list item or some other clickable element, set error handling on the commit activity, set it to continue without rollback and just create another end event. The second time will follow the error path, but since the flow has already succeeded the first time you won’t miss out on anything, but you will get rid of the error.
I've seen this one in the past.
In our case it was 2 datasource microflows on the screen for different dataviews. Both ds flows made use of a getorcreate and both flows tried to commit an address to a report which was a 1-1 association in a single transaction.
In another setup it was objects in a list with the same object being multiple times in the list and the getcreate from database did not check instantiated objects so also that case another object was created and a 1-1 association being committed to multiple objects in a commit list action.
I have also faced this issue but in a different context.
Had a microflow which creates some object based on some information sent from SAP.
For some strange un-explainable reason, two objects were created thus leading to duplicate objects.
Not sure if there is a needle in haystack kind of bug inside the framework itself. Ofcourse we added unique validation to stop creating duplicate objects based on the ID shared by SAP.
In this case also:
- Your OC_IsTeethCareTicked is probably trying to create the object PersonalCare with same ID (10977524092907448)
- And the primary key that conflicts is the general Mendix ID
- So, how could Mendix create two objects at same time with same ID, is something not understandable.
- May be 2 users trying to create PersonalCare object at the same time
NOTE: Check in your database for PersonalCare with ID 10977524092907448 and verify what data exists. If it is the same data as it is being created, then it must be 2 times object created for the same session.