Author Topic: Got stuck on Check Integrity  (Read 3274 times)

ngong

  • EA User
  • **
  • Posts: 269
  • Karma: +1/-2
    • View Profile
Got stuck on Check Integrity
« on: November 15, 2018, 05:45:01 am »
I change from .eap to SQL Server for more stable behavior. It turns out to be true.

However, now I got a problem that I cannot overcome:
When transfering from SQL Server to a local .eap I get "Unrecognized database format" if I try to open the .eap file. And it is true: I expect a size of ~100MByte and get 12kB as the size of the exported .eap-File.

When doing Check Integrity/Project Integrity on the model in SQL Server I am left with one problem: Invalid Realization Stereotype. ITEM: . ACTION: Updated Applies To.

Any time I try to Recover/Clean I get a SQL Server failure Violation of PRIMARY KEY constraint 'pk_stereotypes'. Cannot insert duplicate key in object 'dbo.t_stereotypes'. The duplicate key value is (realization, realize).

What would be the next steps to solve that problem? How can I find the stereotype that caused it?


« Last Edit: November 15, 2018, 05:51:55 am by ngong »
Rolf

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1268
  • Karma: +114/-10
  • Its the results that count
    • View Profile
Re: Got stuck on Check Integrity
« Reply #1 on: November 15, 2018, 06:55:19 am »
I change from .eap to SQL Server for more stable behavior. It turns out to be true.

However, now I got a problem that I cannot overcome:
When transfering from SQL Server to a local .eap I get "Unrecognized database format" if I try to open the .eap file. And it is true: I expect a size of ~100MByte and get 12kB as the size of the exported .eap-File.
I've gotten that error and its to do with eap and eapx where the latter is Jet V4.0 engine and the former V3.5. The older versions of Sparx used to open both even if it was named eap. However you seem to get that error now when opening a Jet 4 db when its got the extension eap. Found by renaming it to eapx it worked ok.
When doing Check Integrity/Project Integrity on the model in SQL Server I am left with one problem: Invalid Realization Stereotype. ITEM: . ACTION: Updated Applies To.

Any time I try to Recover/Clean I get a SQL Server failure Violation of PRIMARY KEY constraint 'pk_stereotypes'. Cannot insert duplicate key in object 'dbo.t_stereotypes'. The duplicate key value is (realization, realize).

What would be the next steps to solve that problem? How can I find the stereotype that caused it?
Sounds like the primary keys have gotten into a bit of tiz. Try reset IDs - the next option down from project integrity
Happy to help
:)

ngong

  • EA User
  • **
  • Posts: 269
  • Karma: +1/-2
    • View Profile
Re: Got stuck on Check Integrity
« Reply #2 on: November 15, 2018, 08:01:30 am »
Thank you Sunshine. For backup I made to export from SQL Sever to an xmi file (as transfer to .eap file does not work). I could import that one to an .eap file.

I started  Reset IDs. However, if I count the Rows, there are ~130000. Reset IDs does ~200 in a minute, that will take roughly 11 hours. Hope nothing disturbs that process. What if this breaks? Is it one transaction, so the old state will be reactivated?
Rolf

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1268
  • Karma: +114/-10
  • Its the results that count
    • View Profile
Re: Got stuck on Check Integrity
« Reply #3 on: November 15, 2018, 02:55:18 pm »
Backing up before resetting the IDs is a good move. Exporting to XMI will work to a point as it will export the model elements and their connectors along with the diagrams. But it won't include other stuff like alternative images or model defined stereotypes etc. Can you not just backup the SQL server? You should have at least a daily backup on that SQL server surely.  Alternatively a transfer to eapx or feap file would be more complete back up. You could try the reset ID on the eapx file then transfer back to SQL Server as an alternative course of action.

Didn't think Reset ID's would take that long. Pretty sure when I did it a while ago it only took about 10 min for a few hundred thousand elements.
Not sure about whether its one transaction but if something does go wrong you've got your backup.
Happy to help
:)

ngong

  • EA User
  • **
  • Posts: 269
  • Karma: +1/-2
    • View Profile
Re: Got stuck on Check Integrity
« Reply #4 on: November 15, 2018, 09:27:23 pm »
Reset IDs went through without failures. However, the problem remains. Check Integrity shows a problem which cannot be repaired.
When it comes to transferring the SQL Server model to an .eap-based model, it got worse. I filed a new question for this.

Exporting to XMI seems - to me for now - to be the only reliable backup. We do not use the specialities that will not be exported with XMI.
I am new to eapx of feap files. How can I transfer to these representations (in the hope not to get the same problems)? Do I need EA14 for it, or will 13.5 do?
Rolf

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12783
  • Karma: +532/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Got stuck on Check Integrity
« Reply #5 on: November 15, 2018, 09:46:30 pm »
Check in the stereotypes list (Configure | UML types) and delete any stereotype with the name Realization (or similar)

Geert

ngong

  • EA User
  • **
  • Posts: 269
  • Karma: +1/-2
    • View Profile
Re: Got stuck on Check Integrity
« Reply #6 on: November 16, 2018, 01:01:43 am »
Ok, that was a good hint, Geert.
If I reconstruct the problem: I imported another model as a certain view that imported the same stereotypes, maybe by an older version. One of them "realizes" was for some reason imported despite it was already there. And got orphaned, was found by integrity check. A repair did not work, because it only saw the good one, and did no repair.

As soon as I deleted the good one - I could not delete the orphaned one - the repair worked. Check Integrity/Project Integrity does not find any problem now.

What is left is, that I am not able to transfer the model from SQL Server to an .eap-file. EA13.5 corrupts the .eap-file before transfering and than mentions that the database format is not correct. But I mentioned this in a different question in this forum.


This one is solved.
Rolf