I had this error before. On what Mendix version are you running? Are you using high volume processing of data with for instance run in background / separate Java transaction logic?
The error states that an association can not be set because it violates the database constraint. This can happen in above scenario when there already is for instance a 1-1 association to the same object and in a separate not coupled, probably with separate Java transaction logic this association was not found yet and the association is put in the database.