Book a Demo

Author Topic: Problem with foreign keys  (Read 7036 times)

ifxrftchief

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Problem with foreign keys
« on: January 28, 2009, 11:44:41 pm »
Hi folks, I have a problem with foreign keys in ea ver 7.1.828.

I have 4 tables, useing MySQL and the ENGINE tag has been set to INNODB. One og the tables has foreign keys into the other tables.

I create the assosiations, enter the cardinality (multiplicity) for each assosiation. Then rightclick the assosiation and choose foreign key.

When I'm done creating the foreign keys, I can see the information of the foreign keys on the assosiations and the 'main' table have gotten new '<<FK>>' operations.

If I generate the code from the diagram, it is perfect, just as I expected.

The problem the occours when I press 'Save', then the fk operation from the tables disapperas, and if I generate the code now, the foreign keys will not be created in it.

Is there any solution to the problem? Am I forgetting something? Or is this just a bug?


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with foreign keys
« Reply #1 on: January 29, 2009, 10:57:23 am »
Which "Save" do you mean exactly?

It sounds like a bug as there are several n the FK area, but first we need to clarify where the FKs are "disappearing".

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

ifxrftchief

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with foreign keys
« Reply #2 on: January 29, 2009, 07:40:55 pm »
I have tried pressing ctrl+s, pressing the save button (disc icon) in the main toolbar and pressing the 'File->Save Project As...' from the main menu.

I have screenshots showing the whole sequence I can email you if you are interested.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Problem with foreign keys
« Reply #3 on: January 29, 2009, 09:13:09 pm »
Hitting the save icon is only there for saving diagrams. If this can make foreign keys diappear (which are contained within the model data) it's very weird indeed.

If you can reproduce this behaviour: could you create a key, make a note of its name, make it disappear by saving, and check whether the key is missing from the model or only from the diagram. If it's still contained within the model, you should find in the project browser, or in an XMI export.

ifxrftchief

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with foreign keys
« Reply #4 on: January 29, 2009, 09:38:53 pm »
I tested this again, heres the what happened:

1) Created the foreign keys, everything seemed as expected.
2) Saved the diagram (with the disc icon), the foreign keys dissapeared from the diagram, but was still pressent in the Project browser.
3) Restarted ea and reloaded the project, the foreign keys has also dissapeared from the project browser.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Problem with foreign keys
« Reply #5 on: January 29, 2009, 09:43:31 pm »
Seems worth reporting directly to Sparx via registered bug report.

ifxrftchief

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with foreign keys
« Reply #6 on: January 29, 2009, 10:54:04 pm »
I will try to file the bug then.

I just have one more thing. I wanted to see if this was generally reproducable so I started a new project. In this new project it seem to function perfectly.

Could there be an global setting not allowing foreign key or something like that? I will try to redo all of my project now.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with foreign keys
« Reply #7 on: January 30, 2009, 06:57:43 pm »
How old is your original project file?

We've encountered situations with very old files that EA can't really handle the "in situ" upgrade.

You may be best advised that if the problem doesn't exist with the new project, to export your entire project and re-import into the new file...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

ifxrftchief

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with foreign keys
« Reply #8 on: January 30, 2009, 08:03:06 pm »
The original project is from this Tuesday, I wouldn't consider that as being "very old" :)