According to the CA help documentation on Erwin, Cut, Copy and Paste functions are fully supported. You could simply select model objects you want to copy and paste them into a new or existing model diagram without any problem.

You can read more about this functionality here: https://supportcontent.ca.com/cadocs/0/CA%20ERwin%20Data%20Modeler%20r9%205-ENU/Bookshelf_Files/HTML/ERwin%20Help/index.htm?toc.htm?Cut_Copy_and_Paste_Functions.html

However, the development community seems to be divided about the efficiency of this method and people still believe that Complete Compare method is the most trusted way of copying objects from one model to another in Erwin.

Some people I know suggest that Cut, Copy and Paste functions work okay within the same model but create host of problems including model corruption if this is done between models.

The conflict comes because it is believed (based on experience of many in Data Architecture community that ERwin corrupts the models when Copy and Paste is done between two models by mixing up the object IDs between two different models for objects involved. Once metadata corruption happens, it becomes a cumbersome job to deal with the issues.

The only proven and preferred way to add a model object from one model to another is by using the “Complete Compare” feature because it seems to work just fine from the early days of Erwin till date.

Complete Compare Causes Erwin Software Crash

There can be other ways the software could crash and I am not saying this is the only bug in the software. However, if your model metadata is corrupt due to Copy and Paste between two models, Erwin crashes automatically the moment you start Complete Compare functionality and click on the “Next>” button when the dialogue box appears.

Here is how the screenshots will look like when this happens and software crashes:

ERwin - Crashed While Doing Complete Compare on Currupt Data Mode - Log File Generated

The above dialog box appears to inform about the crash that is happening and to let you know the location and name of the log file being generated for this crash. And then the next dialog box will appear as shown below that notifies you that it is a Visual C++ runtime error causing the crash:

ERwin-Runtime Error Dialogue Box Just Before The Crash doing Complete Compare on Currupt Data Model

As you can see from the screenshot, the moment you select “Right Model” and click “Next>”, this happens. I have tested this several times and each time it failed at the exact same spot.

When this happens, check the log file it generates before crashing and see if the error message says something like this:

GDM-100 FATAL: Attempting to reference a deleted object.

This error clearly indicates that reference to some model objects have gone missing which would have been a probable result of Cut/Copy/Paste operation. At least in my case, I knew I had done that many-many times during the process of designing that model and obviously, something got messed up.

Fixing Your Corrupt Data Model Using XML Method

The easiest way to fix this metadata corruption issue in the Data Model is to follow the following steps and reset your data model objects (Then you may check-in the fixed model as a new version in your Model Mart):

  1. Get a local copy of your model (in case your model in question is in the Model Mart).
  2. Save the file in XML format using “File -> Save As” option
  3. Give a new name to the XML file you saved in the above step 2.
  4. Open the XML file using “File -> Open” menu and ERwin will show following prompt:

 

ERwin - XML Data Model Import Dialog Box for Validation

 

  1. Click on “Yes” button and let Erwin do the validation after which a new data model will be created which will have the exact same model objects and structure as that of the data model which is corrupt.
  2. Now, save this newly created re-engineered data model as a “.erwin” file which is now free from any metadata corruption.
  3. If you have a central Model Repository, now, you may upload this newly created data model as your new data model file in the Mart repository.
  4. To test if the corruption issue is resolved, try running a complete compare on this file. If ERwin doesn’t crash, you can rest assured that the issue is resolved!

Conclusion

Although CA ERwin help claims that Cut, Copy and Paste operations across models are supported by the software, actually doing that may corrupt your data model as of ERwin 9.5 version as I have experienced. If the corruption happens, Complete Compare can start causing software crash.

However, you can use “Save As XML” feature to recover the model and fix the corruption as it re-generates all the IDs internally fixing the issues automatically. That way, no harm will be done in case you have run into this issue.

Your Turn To Share

Have you come across any other issues in ERwin where it crashes or the data model gets corrupted when you do certain things/activities? Please feel free to share your experience with us. Thank you kindly!