Author Topic: Change in EA not immediately visible in the database  (Read 107 times)

mliebelt

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Change in EA not immediately visible in the database
« on: January 12, 2018, 12:39:54 am »
We currently have problems with the update of the Enterprise Architect database. I will explain what we do, and why it is a problem.

  • We have developed an application that validates EA model entities through rules.
  • This is done by
    • Doing an SQL query directly to the database
    • or getting objects from the database, instantiating them as Java objects and doing the validation then in Java
  • This works well with a local EAP file, with EA Cloud connect on a central model or with ODBC connect on the same model.

When we do a validation, and get as result an entry (e.g. name too short), and we fix then the finding and immediately re-validate, the finding is yet there. Only after some seconds (first measures look like 5-8 seconds), the database is up-to-date, so that a re-validation removes the finding the user just has fixed.

We see that behavior for local EAP files, and for EA Cloud Connections, but not for ODBC connects.

I have here now the following questions:

  • What is the reason for this behavior? It looks like there is some cache in between, so changes don't go (all the time) directly to the database.
  • What can we do to avoid that? Is there some API call that ensures that the EA database is synchronized with its caches (if that is the reason for the mis-behavior)?

We would be glad if anyone would have an idea how we can address that question.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7798
  • Karma: +169/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Change in EA not immediately visible in the database
« Reply #1 on: January 12, 2018, 01:06:17 am »
Changes done in the GUI will be saved to the database immediately upon pressing OK on the dialog.

When using the API object this effectively gets the object from the database and then you are (mostly) working on a cached version of it.
The operation Refresh() on the EA collection will actually reload the the entire collection from the database.

You can also do a Repository.GetXXXByGUID() type of operation to "refresh" your object in memory.

The EA application also keeps a cache of objects, so changes you make to the API object may not appear immediately in the EA GUI.

Geert

Nizam

  • EA User
  • **
  • Posts: 52
  • Karma: +4/-1
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Change in EA not immediately visible in the database
« Reply #2 on: January 12, 2018, 01:10:54 am »
The EA application also keeps a cache of objects, so changes you make to the API object may not appear immediately in the EA GUI.

Especially the Cloud Service (which is the advancement of WAN Optimizer) i guess.

Start sharing EA Models to wider teams now!!.
View EA Diagram Online or Take a Trial Try Now

paul.folder

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Change in EA not immediately visible in the database
« Reply #3 on: January 12, 2018, 09:42:33 pm »
Changes done in the GUI will be saved to the database immediately upon pressing OK on the dialog.

Not sure about that...

Try a test:

  • Create a new local EAP file,
  • Put some content inside (I included a Wireframing > Website Example from the Model Wizard),
  • Change some property (I changed the Webpage Wireframe diagram name to Webpage Wireframe1),
  • Press OK to close the dialog,
  • Immediately go to your file system and keep refreshing the folder where you created the EAP file to see how long it takes for the Date modified timestamp to update.

I experience 3-8 seconds of delay from closing the Properties Editor until I see the Date modified timestamp become updated in the file system. (Windows 7 SP1 x64, NTFS.)