Hello Peter.
We are getting a very odd error:
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_DMX_Log_DMX_Entries'. The conflict occurred in database 'CDSN', table 'DMX_Entries', column 'EntryId'.
How it happens: A user tries to upload a "New Item" (a pdf file) and after clicking "Update", get the error.
We did some db debugging...
- We noticed that new records were being inserted into DMX_Entries, but not DMX_Log, which would account for the error.
- We turned off the constraint to see what would happen to the DMX_Log table after an upload without the constraint.
- Attempted another upload of a document. It was successful, in that a record was inserted in DMX_Entries with correct values, but...
- The DMX_Log table value for entId was 15, whereas the correct value should have been 230118 or something like that. I.e. The last record's EntryId in DMX_Entries table was 230118.
- We turned the constraint back to its orginal setting.
- We turned Identity off for EntryId in DMX_Entries so that we could change the EntryId of one of the new records to 15, so that we can avoid the foreign key constraint error and see what happens.
- We turned Identity back on for EntryId.
- Our upload test was successful in that the DMX_Entries table inserted values correctly, including EntryId being incremented to the next largest value, but...
- With a record in DMX_Entries (EntryId=15) to avoid the foreigh key constraint error, the file was uploaded, however, the value for EntId in DMX_Log was still 15!
- Repeated step 9. Oddly enough, not only does the DMX_Log still keep inserting a value of 15 for entId, but the file listing in the DMX module in the browser only shows the last file uploaded!
- More to report: When viewing the DMX module in DNN, clicking on icon of the disk or the original file name link reveals EntryId=15. How is that possible, considering the DMX_Entries.EntryId for that file was/is 230118 or something like that? Where is it generating that EntryId value of 15?
I have no way of figuring out where it is getting/setting that value of 15 for DMX_Entries.EntryId or DMX_Log.EntId. Do you have any insight into this bizarre error?
Regards,
Dan