Database error and how to fix it...
While reviewing the Adept Server Log, I found an error:
04/24/2018 14:13:14 Adept Server has encountered the following error:
The key data supplied returned multiple rows.
The ReadRecord task requires a full and unique primary key.
S_FILEID : 21a405a6-be9f-4548-9e05-6750d8113364
S_MINREV : 0
Hmm, what is going on here? Keep in mind that there are a lot of things going on behind the scenes when Adept does routine actions. There is a lot of juggling where the database updates records, and moves records from one table to another. And as with any juggling act, sometimes something get's dropped. So in this case, a file had been approved, it got moved around in the vault, it's old record was copied to the revision section of the database, and the new "IN" record was created. But the ball that got dropped was removing the Old "IN" record, so the system saw that 2 records for the same file with the S_MINREV value of 0.
Great, so we know what the problem is, but how do we resolve it? Well you can dust off your SQL books and start to dig in to the database, and perform a search, and... Wait! There is an easier way! in Adept on the System Ribbon, in the Maintenance group, select the Miscellaneous drop down, and choose Database Repair. This will automagically perform an assessment of the different table, detect any problems and report any errors it finds. You can then repair the problems with a simple click of the Repair button. It is that easy.