Book a Demo

Author Topic: "ghost" foreign keys  (Read 12156 times)

Damir

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
"ghost" foreign keys
« on: April 18, 2008, 01:54:19 am »
I'm trying to model data warehouse data model. Table classes also have "dimension" or "fact" stereotype. For some reason, when I added FK relationships between two tables and appended suffix to their name so that they could be uniqe, EA saved FK operations in the table with my name, but when you look through FK relationship dialog box and when you see role name on the association - EA added another suffix (the same number). I figured out some mess has occured so I'll just delete everything and start from the beginning. I've deleted the associations, I've deleted FK operations, but: FK ghost stereotypes remain by the columns that used to be in the FK relationship. How can I get rid of this?
I tried Project Integrity Check and fix-ups but it doesn't work.
any suggestions?
tnx

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: "ghost" foreign keys
« Reply #1 on: April 18, 2008, 07:25:14 am »
How did you delete the foreign keys?

If you didn't do it the way the documentation suggests - I don't have the time to do the lookup for you just now - then you could get some vestiges.

Try adding the keys again, then removing them as per the documentation. You might also be able to accomplish this using the dialog that comes up when you start to add the new keys.

David
No, you can't have it!

Damir

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
Re: "ghost" foreign keys
« Reply #2 on: April 18, 2008, 07:36:30 pm »
OK, I've managed to delete the "ghost" FKs by creating new associations and defining new FK relationships and then deleting them. But here is an interesting "feature":
1. I create (directed) association
2. I add FK relationship on it
3. I delete FK relationship by opening foreign key dialog box and deleting it from there.
4. EA leaves the association ofcourse, but it also leaves association roles and multiplicities it added when creating the FK relationship
5. I've checked, there are no FK operations left
6. on the same association, I try to add a new FK relationship using the FK dialog box: when I select appropriate columns in both tables and hit the SAVE button - IT DOESN'T HAPPEN: no FK relationship is added, and EA doesn't report any error or warning.

although the mentioned association should have been left "clean" from the previous deletion of FK relationship - it obviously has something that creates this problem. You have to delete the association as well and then start all over again.
-----------------------------but never mind that, it's a feature I can live with, but this IS a problem: ----------------
I'm using build 827 of EA, I'm modeling MS SQL server database
- Let's say you have tables A and B
- there are 2 FK relationships you have to add from A to B
- first I add association 1 from A to B
- then I add a FK from column A1 to column B1; EA gives name to this FK constraint FK_A_B, and it also gives a name to association role of table A: +FK_A_B
- then I add second association 2 from A to B
- then I TRY to add a FK on that assoc.2. from columns A2 to column B1; EA has tried to give name to this FK constraint FK_A_B, but since such constraint already exists it gives warning.
- just for any case I try to save one more time but it gives the same warning :)
- OK, I rename manually the name of the FK constraint to "FK_A_B1"
- then I press the save button
- EA then makes a MESS:
-- it gives a name to association role of table A: +FK_A_B11 (notice two "1")
-- when you open FK constraint dialog box, there the name of the seconf FK constraint is also FK_A_B11 (EA added second "1" I guess)
-- watching the FK constraint in the dialog box, it is, well, broken: target column B1 is left as it is, but the source column A2 is missing!
-- watching the first FK constraint in the dialog box, I notice the first constraint is broken in the same way!
-- then when you open operations dialog box of the table A, you'll find two identically named operations: FK_A_B1 (notice just one "1")
- if you add other associations and FK constraints between A and B, the problem just multiplies

This is quite serious. I can't find anything that would indicate that I have messed things up.

Any suggestions?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: "ghost" foreign keys
« Reply #3 on: April 20, 2008, 09:26:23 pm »
In my opinion - which agrees with yours - you are seeing two bugs here Damir.

First, the "never mind" issue is serious enough that it does need to be resolved.

Submit both of these to Sparx in a bug report - or two reports if you have the time. You should past in the URL of your most recent post - the one I'm replying to now - so that Sparx can see any discussion. If possible attach a compressed project where you have attempted to remove a relationship but vestiges remain.

I suspect there might be a workaround, and that Sparx can provide it to you. But given that they did not respond last week - remembering that they are on Australian time of course - it is worth pursuing this now.

You'll find the correct link by clicking Report a Bug below the Support link near the bottom of any forum page. If you are a registered user you should then click the appropriate link at the top of the next page, just above the form. The registered user page will let you attach your project file.

Please let us know if Sparx sheds any light on this issue.

David

PS: If this is a bug, Sparx is very good at resolving this kind of thing.
« Last Edit: April 20, 2008, 09:26:55 pm by Midnight »
No, you can't have it!

Damir

  • EA User
  • **
  • Posts: 84
  • Karma: +0/-0
    • View Profile
Re: "ghost" foreign keys
« Reply #4 on: April 25, 2008, 03:55:03 pm »
We've managed to isolate at least one bug. Here is the original tekst describing how to reproduce it (not that much important now):
1.     Add association and FK_RadnikPodaci_Datum from DatumRodjenjaID to DatumID
2.     Add association and DO TRY to add FK_RadnikPodaci_Datum from DatumZasnivanjaROID to DatumID
a.     EA says that a FK with that name already exists
b.     OK, put FK name to be FK_RadnikPodaci_Datum1 and hit SAVE button
3.     Add association and DO TRY to add FK_RadnikPodaci_Datum from RDRjesenjeDatOdID to DatumID
a.     EA says that a FK with that name already exists
b.     OK, put FK name to be FK_RadnikPodaci_Datum1  and hit SAVE button
                                          i.    IT PASSES!! Without warning
There you go, now you have two FK-s with the same name. It seems that algorithm for FK name duplicate checking doesn't take into account that there could be more than 1 previous FK relationship without „default“ fk name between same tables or something.

and final answer from EA:
Thanks for your node. This issue have fixed, the Alias number is C0804327- Resolve check the name of Foreign key does already exist for this connector. Hopefully this change can be approve in EA Build 830 otherwise will be available on future build.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: "ghost" foreign keys
« Reply #5 on: April 25, 2008, 08:52:02 pm »
Bingo!

Thanks for taking the lead on this one Damir.
No, you can't have it!