Dropzone widget gives an error duplicate key value violates unique constraint - Mendix Forum

Dropzone widget gives an error duplicate key value violates unique constraint


We are using dropzone widget for batch upload of multiple files (without event actions). When using this widget we encounter regularly "duplicate key value violates unique constraint" error. It is not easy to reproduce this issue, once in X times it keeps giving this error.


I’ve tried to change the Widget itself by adding delays in the code (before mx.data.create / mx.data.commit), with the idea that the server side would have more time to serve the concurrent events. But this did not help.


Does someone (Chris de Gelder) has an idea of this widget related issue?

(Seen this error is widget specific and not a native Mx button/microflow related, I expect that other workarounds mentioned at the forum are not applicable (disable during action, add blocking popup, commit autocommited objects)

EDIT 1: We have explicitly committed the object before, which seems solving the problem for now.

3 answers

This problem should be solved with the latest version, however it seem to pop up every now and then. You can try the previous version which does an explicit commit as you describe.


Is there a one on one relation somewhere of those filedocuments? I have seen some strange behaviour when working with filedocuments and one on one relations and trying to replace an object that uses that reference. Sollution was to clear the reference first before setting the new reference.





It might be related to https://forum.mendixcloud.com/link/questions/89644 see the answer of Jaap Pulleman