I have a C# script performing create/update operations to EA diagrams. It's working good with EA 15. But when I run it with EA 16, it fails with the error - "No such diagram found having diagram GUID:"
Here is the details of example user case. Script is connecting with one user to EA and creating diagram. Now next time script runs and connects with another user to EA and try to update earlier created diagram.
Based on the new version 16 document, I know that it's required to be reloaded. When I try to update the same diagram from the EA UI, I get the error and it asked to reload that diagram. After reload I am able to update the diagram from the UI.
Same thing I tried from the code to reload the diagram (using Repository.ReloadDiagram (currentDiagram.DiagramID);) and then update (diagram.Update()), but still I am getting same error.
Also tried to login with 2nd user in UI and set the reload changed diagram to true from Design->Diagram->Options->auto reload changed diagram. This also does not reload the diagram and shows pop up to reload before updating entity.
Update: Here is the code snippet that I am using. It gives error on second diagram.Update() i.e. after connecting to user2 and trying to update diagram from his connection with following error "No such diagram found having diagram GUID: "
{
//connect to user1
EAConnection connection = new EAConnection();
connection.EARepository = new Repository();
connection.EARepository.SuppressSecurityDialog = true;
connection.EARepository.SuppressEADialogs = true;
bool isOpened = connection.EARepository.OpenFile2("path", "user1", "password");
//update diagram with user1
diagram = repository.GetDiagramByGuid(guid);
repository.ReloadDiagram(diagram.DiagramID); //reload diagram object
//update attribute values
diagram.Name = "xyz";
diagram.Update();
//connect to user2
EAConnection connection = new EAConnection();
connection.EARepository = new Repository();
connection.EARepository.SuppressSecurityDialog = true;
connection.EARepository.SuppressEADialogs = true;
bool isOpened = connection.EARepository.OpenFile2("path", "user2", "password");
//update diagram with user2
diagram = repository.GetDiagramByGuid(guid);
repository.ReloadDiagram(diagram.DiagramID); //reload diagram object
diagram.Name = "abc";
diagram.Update();
}