2 Replies Latest reply: Jan 24, 2013 5:52 AM by Haakon RSS

    Page copy error in 4.2.1

    Haakon
      Hi all,

      just upgraded our Apex server to 4.2.1.00.08 and are now getting the following error when trying to copy a page from development server to production server:
      Execution of the statement was unsuccessful. ORA-20001: Error creating page name="Renewals" id="25" ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_STEP_UI_FK) violated - parent key not found
      
      begin
       
      wwv_flow_api.create_page (
        p_flow_id => wwv_flow.g_flow_id
       ,p_id => 25
       ,p_user_interface_id => 65830370515616 + wwv_flow_api.g_id_offset
       ,p_tab_set => 'T_MONITORING'
       ,p_name => 'Renewals'
       ,p_step_title => 'Renewals'
       ,p_allow_duplicate_submissions => 'Y'
       ,p_step_sub_title => 'Renewals'
       ,p_step_sub_title_type => 'TEXT_WITH_SUBSTITUTIONS'
       ,p_first_item => 'AUTO_FIRST_ITEM'
       ,p_include_apex_css_js_yn => 'Y'
       ,p_autocomplete_on_off => 'ON'
       ,p_step_template => 15024619232924512 + wwv_flow_api.g_id_offset
       ,p_page_is_public_y_n => 'N'
       ,p_protection_level => 'N'
       ,p_cache_page_yn => 'N'
       ,p_cache_timeout_seconds => 21600
       ,p_cache_by_user_yn => 'N'
       ,p_help_text => 
      'No help is available for this page.'
       ,p_last_updated_by => 'BIRMAG'
       ,p_last_upd_yyyymmddhh24miss => '20130114142443'
        );
      null;
       
      end;
      
      ORA-20001: Error creating page name="Renewals" id="25" ORA-02291: integrity constraint (APEX_040200.WWV_FLOW_STEP_UI_FK) violated - parent key not found 
      This effectively makes it impossible to distribute application changes from development to production.
      I've found doc.ID 1511391.1 on the Oracle support pages that says to manually edit the export file, replacing the p_user_interface_id with a valid id from the target database, but this is of course no good as a permanent solution.
      Anyone know if a patch for this in the pipeline?

      Kind regards,
      -Haakon-
        • 1. Re: Page copy error in 4.2.1
          Patrick Wolf-Oracle
          Hi Haakon,

          single component export/import is only supported for application which are identical on the source and target system. It relies on the fact that other referenced components (for example user interface, templates, ...) use the same IDs on body systems.

          Because of the APEX 4.2 upgrade, that's not the case anymore. As part of the upgrade, several new components had to be created on the fly which do now have different IDs on dev and prod. That's why the single component export/import doesn't work anymore.

          If the single component export/import is used to patch applications, it's recommended to do a full export of the app on dev and import it into prod after upgrading to a newer version of APEX to make sure that body systems are using the same component IDs. After that your single component deployment should work as before.

          Regards
          Patrick
          -----------
          My Blog: http://www.inside-oracle-apex.com
          APEX Plug-Ins: http://apex.oracle.com/plugins
          Twitter: http://www.twitter.com/patrickwolf
          • 2. Re: Page copy error in 4.2.1
            Haakon
            Ok, thanks Patrick.

            I understand the reason behind this problem. I guess we've been spoiled so far with the ease and simplicity in which Apex has worked. Few to none issues with upgrades and installations.

            In a perfect world, we should be able to retire a complete production version of an application and replace it with a new baseline from the development server. Unfortunately that's not always the case in the real world.
            Due to infrastructure/network/shares/database differences there's sometimes a need for minor code changes when components are propagated to production. In any programmers bible this is ideally a big no-no of course, but sometimes the extra code to handle such issues is just not worth it on smaller applications. Guess this forces us to do that extra coding now :-)

            Regards,
            Haakon