This discussion is archived
8 Replies Latest reply: Jan 31, 2013 5:00 AM by 766286 RSS

3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?

766286 Newbie
Currently Being Moderated
How to verify and fix, if necessary, a design that is likely to be corrupted? I first suspected I corrupted file when an attempt to reverse-engineer changes from the relation model to the logical did not work. After some investigation I found datamodeler.log file to which the following error was emitted whenever the reverse-engineer button was clicked: 2013-01-28 11:39:32,001 [AWT-EventQueue-0] ERROR MDBAction - java.lang.NullPointerException. This error message is reproducible. There are also additional warnings in the log whenever this particular design is opened such as [Thread-133] ERROR XMLTransformationManager - Unable to load object from XML: ..../model/dw/rel/A864FBB0-411F4EF06C86/table/seg_0/C4046530-1A69-AD31-6127-390C93D8F7F7.xml java.io.FileNotFoundException. The design has been moved from one Data Modeler version to another over the years. It is currently version controlled by SVN but, alas, I have not been able locate a fully functional copy from the repository. (People usually only use forward engineering from the logical model which appears to work fine most of the time.)

I have investigated the design and located a single table object in the relational model that appears corrupted. It cannot be removed from the design with the DataModeler UI (nothing happend when I click on delete on the object menu). I then checked out a testing copy of the design and manually removed all the files with the object identifier in the file name. Additionally, I searched for xml blocks with a reference to the object identifier and deleted the corresponding blocks from those file. After that the reverse-engineering button began to function again. However, I am afraid of commiting a manually edited design to the repository as I am not certain that I have not broken something else.

What is the recommended way to verify a design and fixing problems in it? Starting a new design from scratch is not an option since there is plenty of documentation within the design that cannot be easily obtained elsewhere. I could recreate the broken objects from the data dictionary if I first had a safe way to identify and delete them from the design.

Best regards,

Miikka
  • 1. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    Philip Stoyanov Guru
    Currently Being Moderated
    Hi Mikka,

    you can try:
    1) delete *.local files and switch to Data Modeler 3.1.4
    or
    2. switch to DM 3.3 EA1 (DM 3.3 EA2 will handle that better when it's released)

    Philip
  • 2. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    766286 Newbie
    Currently Being Moderated
    Dear Philip,

    Thank you for your quick reply. I tried both suggestions but neither of them worked. I took a clean checkout of the design and upgraded Data Modeler to 3.1.4. There were no *local files to delete after the checkout. The reverse-engineering button still emits NullPointerException to the log and there is one table that cannot be deleted from the design. I then upgraded to 3.3EA and again checked out a clean working copy of the design but the problem still persists.

    What will I break if I just take the object id of the problematic table and delete all the files of that name and the XML blocks containing the string?

    Best regards,

    Miikka
  • 3. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    Philip Stoyanov Guru
    Currently Being Moderated
    can you run following script as it's explained here Re: Switch from v3EA4 to v3.0.0.4 production - Corrupted models?
    Philip
    outFile = new java.io.File("d:/print_rel.txt");
    outstr = new java.io.FileOutputStream(outFile);
    out = new java.io.PrintStream(outstr,true);
    java.lang.System.setOut(out); 
    java.lang.System.setErr(out);
    contr = model.getDesign().getRelationalDesign().getMainView().getController();
    try{
     contr.getRevEngineer().doActionPerformed(null);
    }
    catch(err){
     if(err.javaException!=null){
      err.javaException.printStackTrace();
     }
    }
  • 4. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    766286 Newbie
    Currently Being Moderated
    Dear Philip,

    Execution of the script you provided created an empty file. There are no new entries in the Data Modeller log file. After studying the thread you linked, I performed the following steps:

    1) A clean checkout of the design from the SVN repository.
    2) Launched Data Modeller (3.1.4) and added your script as a new transformation (relational, Mozilla Rhino, model). Saved the script.
    3) Opened the design.
    4) Executed the script by selecting it from the transformations and clicked on Apply.
    - A message dialog pops up telling me of a finished transformation.
    - An empty file appears to the location specified in the script.

    Best regards,

    Miikka
  • 5. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    Philip Stoyanov Guru
    Currently Being Moderated
    Dear Mikka,

    sorry for incomplete instructions I put in previous post. You should manually run engineering to logical model after you executed transformation script.
    I hope exception will be logged in the file.

    Regards,
    Philip
  • 6. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    766286 Newbie
    Currently Being Moderated
    Dear Philip,

    Thank you for the simpler instructions. I did the following steps and this time an error was logged to print_rel.txt.

    1) Open the design.
    2) Apply the transformation.
    3) Click on the reverse-engineering button to reverse-engineer from the relational model to the logical model.
    4) Find the following results from print_rel.txt.

    java.lang.NullPointerException
         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addFK(Unknown Source)
         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.addFromRelationalModel(Unknown Source)
         at oracle.dbtools.crest.model.design.engineering.RE_RelationalToLogical.<init>(Unknown Source)
         at oracle.dbtools.crest.swingui.engineeringcompare.EngineeringCompareDialog.<init>(Unknown Source)
         at oracle.dbtools.crest.swingui.relational.ControllerRelational$RevEngineer.doActionPerformed(Unknown Source)
         at oracle.dbtools.crest.swingui.MDBAction$ActionInvoker.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
         at java.awt.EventQueue.access$000(EventQueue.java:84)
         at java.awt.EventQueue$1.run(EventQueue.java:602)
         at java.awt.EventQueue$1.run(EventQueue.java:600)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


    Best regards,

    Miikka
  • 7. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    Philip Stoyanov Guru
    Currently Being Moderated
    Hi Mikka,

    thanks for the info provided.
    You can use following script to see wrong foreign keys - in form table_name.fk_name:
    log_rep = new Packages.oracle.dbtools.crest.swingui.LogReport(model.getAppView());
    log_rep.setName("wrong FKs");
    text = "";
    fks = model.getFKIndexAssociationSet().toArray();
    for(var i=0;i<fks.length;i++){
         fk = fks;
         if(fk.getRemoteIndex() == null){
              text = text + "\n" + fk.getLongName();
         }
    }
    log_rep.setLog(text);
    log_rep.showModalDialog(new java.awt.Dimension(750, 550));
    and following script to remove them
    fks = model.getFKIndexAssociationSet().toArray();
    for(var i=0;i<fks.length;i++){
         fk = fks[i];
         if(fk.getRemoteIndex() == null){
              fk.remove();
         }
    }
    Now you can remove the table if you want to. Save design at the end.
    
    Regards,
    Philip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  • 8. Re: 3.1.3.709: How to Verify and Fix a Possibly Corrupted Design?
    766286 Newbie
    Currently Being Moderated
    Dear Philip,

    Your solution works like a charm. Thank you!

    Best regards,

    Miikka

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points