cube1us / IBM1410SMS

Database Program for capturing data from IBM SMS Automated Logic Diagrams and related database layer
GNU General Public License v3.0
0 stars 0 forks source link

Duplicate database IDs, perhaps during import #1

Closed cube1us closed 4 years ago

cube1us commented 4 years ago

While I was moving certain pages from being ALD diagram pages to be cable/edge location pages, I found duplicate database IDs, which are supposed to be unique throughout the system. That uniqueness depends on incrementing the counter field in the iDCounter table. The duplication was between the idDiagramPage field in the diagramPage table and the idCardLocation field in the first cardLocation table entry that referred to that page. I suspect, but do not know, that this was in the Card Location page import code.

cube1us commented 4 years ago

The issue was indeed in ImportCardLocationChartl.cs in line 635
"newDiagramPage.idDiagramPage = IdCounter.getCounter();"

Should have been a call to IncrementCounter().

By looking for calls to getCounter I also found one Importer.cs, which could result in volumes and volume sets having the same ID, though I don't see any of those in the database.

There are no calls to getCounter anymore. I commented out that method to prevent future errors of that sort. (Of course, methods can still save the current value and use it in the wrong place.)

However, I was unable to find any currently in the database. Perhaps they were all in pages that got changed into CableEdgeConnetionPages -- those all got removed from the card location table and their pages and card location pages removed.