Reputation: 23
We are still using ECO5 with VS 2008. A "non eco" application uses the same database as our eco-application does and inserts data. The inserted data (objects) cannot be seen in our eco - application, unless we restart this application. It is not necessary to restart the persistence server, and I assume we inserted data correctly (respecting inserts into ECOModelRoot and incrementing ECO_ID), since the eco-application shows them correctly after restart.
We tried to set the ecospace.active to false and then to true again, and ecospace.persistence.refresh(true). The inserted data still were not displayed, although also the regarding query was closed before and opened afterwards.
How can we make our eco-application see the "non - eco" inserted objects?
Upvotes: 0
Views: 63
Reputation: 201
If you insert or update objects from a "third party application" you can use selfVM.SuspectExternalUpdateInvalidate(listOfObjectsYouSuspect).
Doing so will notify the SyncServer (you have a sync server in MDrivenServer) that this row needs to be reread completely - by all clients that has this row cached.
Clients will be get this information when doing their next Refresh (available via selfVM.Refresh and as framework action). If you use a MDrivenServer, clients will be notified by push notification and quickly update their UI.
To read more and for a full example on how to use this feature, see https://wiki.mdriven.net/index.php/SQL_Server_change_tracking
If you use MS SQL Server, there are also examples in the wiki on how to automatically track table changes efficiently and to refresh those.
Note! You need a framework from June 2018 onwards for this feature to be available.
Upvotes: 0
Reputation: 128
When you've inserted your data correctly, your scenario is identical to a scenario where two independant ECO applications are writing to the same database.
So, in able to answer your question we need to know more about your applications architecture because normally it would be sufficient to shut down the ecospace by setting active to false. Some type of chaching is still happening.
There are also ways in invalidate the cache of an EcoSpace for specific objects or classes but you first have to find out, where your prolem is located.
Upvotes: 1