1

The official Oracle document 1982130.1 describes the missing feature that currently prevents us from migrating from mod_plsql to ORDS:

Migrate a Non-Apex PL/SQL application from Oracle HTTP Server to Oracle REST Data Services (ORDS) 2.0.9. When running the PL/SQL application with Oracle REST Data Services, got the following error message: "ORA-20888: p_application_id must be provided" error in catalina.out regardless of the value of that parameter.

What are others doing to migrate a non-Apex application from mod-plsql to ORDS?

doberkofler
  • 9,511
  • 18
  • 74
  • 126

1 Answers1

4

ORDS 18.3+ the logic changed to make it easier for non-apex. Here's the new logic in a flow chart hopefully make it easy to follow.

enter image description here

In Previous to 18.3 and below here's how to accomplish the same >

The catch is right now is there's a hacky workaround to getting this to work and that's to pretend apex is too old to use that code path. ( yeah yeah I'll fix this )

In the db user that is configured in the connection pool file, create this view. The code checks that if apex 4+ is installed to use that. This view is how that is checked so forcing ords to thing apex is old will make the plain 'ol DOC Table path be used.

create view apex_release as
  select '1.0.0.0' VERSION_NO from dual;

url-mapping.xml

<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
   <pool base-path="/klrice" name="klrice" />
</pool-config>

conf/klrice.xml

The parameter is named apex.docTable and this will default to "FLOWS_FILES.WWV_FLOW_FILE_OBJECTS$"

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
  <entry key="db.username">klrice</entry>
  <entry key="db.password">klrice</entry>
  <entry key="apex.docTable">klrice.MYDOCTABLE</entry>
</properties>

My Table

KLRICE@xe >CREATE TABLE MYDOCTABLE (
  2    NAME               VARCHAR(256)   UNIQUE NOT NULL, 
  3    MIME_TYPE          VARCHAR(128), 
  4    DOC_SIZE           NUMBER, 
  5    DAD_CHARSET        VARCHAR(128), 
  6    LAST_UPDATED       DATE, 
  7    CONTENT_TYPE       VARCHAR(128), 
  8    CONTENT            LONG RAW, 
  9*   BLOB_CONTENT       BLOB );

After being called:

  1* select BLOB_CONTENT from MYDOCTABLE
KLRICE@xe >/

BLOB_CONTENT                                                                    
--------------------------------------------------------------------------------
89504E470D0A1A0A0000000D49484452000000C8000000C80806000000AD58AE9E00000001735247
Kris Rice
  • 3,300
  • 15
  • 33
  • Thank you for the extensive feedback and a few more questions: my application does not use apex, but is there a difference between having apex installed or not? What actually changed in the latest version or was this also possible before? Is it actually all about the apex_release view tricking ORDS to believe that there is no apex available? – doberkofler Feb 14 '18 at 14:09
  • 1
    It was possible before just as you can see very non obvious. I’m fixing it this week properly that if a new param owa.docTable is set it does that directly no workarounds. – Kris Rice Feb 14 '18 at 14:11
  • So it will be available “soon” in a minor ORDS update? – doberkofler Feb 14 '18 at 14:15
  • Yeah that’s as much as I can say... soon. – Kris Rice Feb 14 '18 at 14:17
  • 1
    Looking forward to it. Thank you! – doberkofler Feb 14 '18 at 15:30
  • @Kris Rice did owa.docTable get released? I am working on porting a mod_plsql app to ORDS (so far it is working great). I need to tackle file uploading next. I am using v18.2. – Brian McGinity Jul 15 '18 at 02:02
  • 1
    Yes in 18.3 this was overhauled to act better. That's coming soon. I'll blog about the changes. – Kris Rice Oct 03 '18 at 12:30