Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle REST Data Services (ORDS) as a PL/SQL Gateway and huge files downloading

Alex MyzikaJan 27 2025 — edited Jan 27 2025

Hello everybody!

I use Oracle REST Data Services (ORDS) as a PL/SQL Gateway to enable access to my Oracle Apex application from Oracle Web Logic Server.

Currently Oracle WebLogic Server 14.1.1.0.0 and ORDS 21.4.0.348.1956 are in use.

The users of my Oracle Apex application should download files stored in BLOB columns and they do it successfully if file size does not exceed 2 Gb.

If file size exceeds 2 Gb then 500 Internal Server Error are raised.

The reason for this error are known for me from Web Logic errors log:

####<23.12.2024 9:14:46,293 EST> <Error> <oracle.dbtools.rest> <cpnappsrv> <WebServer> <[ACTIVE] ExecuteThread: '14' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <62251b98-5f1d-4f63-99e7-68cde4f98af5-00000146> <1734934486293> <[severity-value: 8] [rid: 0] > <BEA-000000> <<62251b98-5f1d-4f63-99e7-68cde4f98af5-00000146> GET xxxxx.xxx.com /ords/f?p=101:178:10720159412426:DOWNLOAD_FILE:::P178_ID_FILE:11034280 500 Internal Server Error

InternalServerException [statusCode=500, logLevel=SEVERE, reasons=[]]

Caused By: java.net.ProtocolException: Exceeded stated content-length of: '-294494650' bytes

The investigation shows that it is common error for servlets which downloads large (more than 2 Gb) files. Solution of the problem also quite simple, for example:

https://todayguesswhat.blogspot.com/2012/07/file-download-java-servlet-example-2gb.html or https://forums.oracle.com/ords/apexds/post/exceeded-stated-content-length-error-3319 .

But not in my case, because it’s impossible for me to develop my own custom servlet for this, I use ORDS as I told before.

So I need your help and would be appreciate you for any ideas which could give me assistance and overcome this problem.

Thank you in advance.

Comments

thatJeffSmith-Oracle Feb 13 2025

Your ENTRA users will get authenticated via JSON Web Tokens, and their Entra roles will determine which ORDS REST APIs they can hit.

When they hit an endpoint, it'll execute code in the database as the database user that owns the schema where the REST API is defined, not as Entra defiend end user. In fact, the Entra users won't have accounts in the database (they could, but wont' need to).

The :current_user field as far as ords is concerned would be the corresponding oauth2 client or JWT issued for the authorizied session.

Your prehook should be able to alter the session to set the context that would put your RLS/VPD security policy in play.

1 - 1

Post Details

Added on Jan 27 2025
0 comments
169 views