Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: Bhavesh on November 27, 2009, 11:46:34 pm

Title: GUID integrity
Post by: Bhavesh on November 27, 2009, 11:46:34 pm
Hello guys,

I wanted to confirm about possibility of GUID changing.
What happens when "Strip GUID" is checked?
Could it change during import/export?
Or any other way.

Thank you.

Bhavesh.
Title: Re: GUID integrity
Post by: Geert Bellekens on November 28, 2009, 12:14:26 am
If you import a package with "strip guid" it will assign all new guids to all the imported elements.

Geert
Title: Re: GUID integrity
Post by: Bhavesh on November 28, 2009, 01:16:27 am
I asked because we're doing something based on this GUID and we've exported/imported tens of packages. But it happened once recently that GUIDs were changed in XMI file.

Is it possible for GUIDs to change when somebody restores EA db backup, works in EA and exports XMI?

Thank you.

Bhavesh.
Title: Re: GUID integrity
Post by: Geert Bellekens on November 28, 2009, 01:24:18 am
I'm pretty sure it can only happen when importing xmi files.

Geert
Title: Re: GUID integrity
Post by: Bhavesh on November 28, 2009, 01:26:19 am
I wasn't going to start this thread and bother you because it has happend only once.

Thank you for reassuring me.

Thank you.

Bhavesh.
Title: Re: GUID integrity
Post by: Oliver F. on November 28, 2009, 02:05:08 am
To summarize the GUID issue and to add what Geert said:

The GUID is unique across all elements inside a EA project (propably also outside though I have not checked this).
GUIDs never change for an element unless it is deleted and recreated.

Exporting elements also exports the GUIDs, reimporting the elements reimports them with the former GUIDs so that all references to elements are still valid and existing. New elements in the xmi file get new unique GUIDs.

Reimporting the elements with the "strip GUID" option set reimports the elements with new GUIDs (by freshly/redundantly creating those) so references from the former project are not restored.

Oliver
Title: Re: GUID integrity
Post by: Geert Bellekens on November 28, 2009, 04:38:18 pm
Quote
The GUID is unique across all elements inside a EA project (propably also outside though I have not checked this).

Oliver,

By the very nature of a GUID (Globally Unique Identifier) you can expect it to be unique amongst all GUID's ever created.

Theoretical there is of course a chance that two GUID's are created with exactly the same value, but I think that is as likely as me winning the lottery two weeks in a row.

Geert
Title: Re: GUID integrity
Post by: son-of-sargasso on November 28, 2009, 07:03:41 pm
Quote
but I think that is as likely as me winning the lottery two weeks in a row.

Actually, theoretically, if the 122 "random" digits in the GUID are truly random then I think you'd have to win a lottery with 50,000 tickets about 8 times in a row.

However, the 122 digits are not truly random and if they use an algorithm that includes the MAC address of the local computer and a single timestamp, then the likelihood of the collision is a lot higher.

But, then again, my problem is winning the lottery one time in a row.   :(

bruce
Title: Re: GUID integrity
Post by: Oliver F. on December 01, 2009, 12:10:47 am
Quote
But, then again, my problem is winning the lottery one time in a row.   :(

I have that very same problem so the chances that one of us is winning the lottery once have at least doubled.

BTW, does it affect propability that I never play such things?  ;)

Oliver
Title: Re: GUID integrity
Post by: Geert Bellekens on December 01, 2009, 12:16:10 am
Quote
BTW, does it affect propability that I never play such things?  ;)
Naa, not significantly :D

Geert
Title: Re: GUID integrity
Post by: Paolo F Cantoni on December 01, 2009, 12:44:17 am
Quote
But, then again, my problem is winning the lottery one time in a row.   :(
Well, of course, someone has to win...  (but the chances are it won't be you...)

Paolo