Book a Demo

Author Topic: Saving a diagram error message  (Read 6760 times)

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Saving a diagram error message
« on: May 07, 2010, 01:26:24 am »
Hi all,

I've got some automation code that creates a diagram but when I issue the .SaveDiagram method I get an error message of "Warning: Diagram has possibly been modified by another user. Press OK to continue etc..."

How do I prevent this message from appearing? Or, apart from the obvious - which isn't happening, what causes it? :-?

TIA
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Saving a diagram error message
« Reply #1 on: May 07, 2010, 05:56:13 pm »
Martin,

If the diagram was indeed not modified by another users while your code was editing it, then I guess there's an error in the marshalling/unmarshalling process.
I can imagine that, when a diagram object is constructed the API gets the details from the diagram and stores them into the object.
When then it tries to save the diagram it will compare the modified_date in the dataabse with the date it has retrieved.
If db.modified_date > object.modified_date then it would issue the warning.
Now if for some reason the retrieved dat gets truncated or something like that, that could cause this type of error.

But I'm just guessing :-/

Geert

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Saving a diagram error message
« Reply #2 on: May 07, 2010, 06:18:06 pm »
Hi Geert,

Hmmm...  There's certainly isn't anyone else editing it as it's on my local machine but I hear what you're saying.

I don't think it used to do it - but that may have been when the whole addin wasn't doing what it should have!  ;)

So I'll just have to have another look at my code.

Thanks anyway.

Martin


Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Saving a diagram error message
« Reply #3 on: May 07, 2010, 07:37:27 pm »
Martin,

this need not be your fault. I don't know what version you're using, but I remember that in 7.1. I frequently had this behaviour without any AddIns, i.e when I had serveral unsaved diagrams open in a local EA project, it used to pester me with this stupid message.

This seems to have stopped with version 7.5, but I wouldn't bet my head on it.

Maybe the easiest thing to do is to save the stupid diagram after each operation that changes anything.

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Saving a diagram error message
« Reply #4 on: May 07, 2010, 08:19:36 pm »
Thanks Frank. I'm using v7.5.845.

I've got two loops where I'm adding UC's to a diagram and I save after it exits from the inner loop.

I'll try saving after each addition but that could be quite slow. :(


beginner

  • Guest
Re: Saving a diagram error message
« Reply #5 on: May 07, 2010, 09:06:36 pm »
I still get this message with 8.0 but only when working with EAP files. I suppose it's got to do with the underlying Jet driver (Sparx is still using the pre-diluvian version 3) but I haven't experimented with that.

b.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Saving a diagram error message
« Reply #6 on: May 07, 2010, 09:16:26 pm »
Might be wirth a try to test if this issue also occurs when the model is stored in a proper database (and not eap file)

Geert

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Saving a diagram error message
« Reply #7 on: May 07, 2010, 09:17:03 pm »
I've just moved my saving line to the inner loop. Disaster! :o It now asks every time, which is a real PITA!!

I'll just have to live with it just the once when it's finished all the updates to the diagram.

Martin Walke

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Saving a diagram error message
« Reply #8 on: May 07, 2010, 09:30:59 pm »
Ok - by being pragmatic and having the Save inside the loops, was actually causing me the problem!

Move the instruction to the end of my procedure and it's quite happy... and so am I ... now.. ;D

Thanks everyone

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Saving a diagram error message
« Reply #9 on: May 07, 2010, 09:35:59 pm »
So does this always happen when saving a diagram for the second time, (without reloading it from the database)?

Geert

beginner

  • Guest
Re: Saving a diagram error message
« Reply #10 on: May 07, 2010, 09:38:55 pm »
Quote
Might be wirth a try to test if this issue also occurs when the model is stored in a proper database (and not eap file)

Geert
I guess so, since it does never happen with MySQL. This doesn't help those forced to work with EAP files, though.

b.