Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Oracle Apex images and ORDS connection pool flawed concept?

Hi community,
Environment:
Oracle Apex 21.1 Patch 5, Oracle REST DataServices (ORDS) 21.2.0.174.1826, Tomcat
I create a page in which I create a Cards region with a Cards container template. The sql source has a blob column that contains images.
Media:
Source: BLOB column
BLOB Column: MED_CONTENT
Position: First
Appearence: Auto
Sizing: Cover
Pagination:
Type: Page
Cards per Page: 64
At run time, only a few of the 64 images are displayed.
The Tomcat log shows the following:
503 ORDS was unable to make a connection to the database. This can occur if the database is unavailable, the maximum number of sessions has been reached or the pool is not correctly configured.
In line with the recommendations found on the Internet, I increased the number of JDBC connections in the ORDS configuration, which solved the problem. All images are displayed and there is no error in the Tomcat log.
<entry key = "jdbc.InitialLimit"> 16 </entry>
<entry key = "jdbc.MinLimit"> 16 </entry>
<entry key = "jdbc.MaxLimit"> 256 </entry>
However, the solution is not good because the error was not caused by a large number of users, but by a simple query.
It causes several problems:
- All developers need to know about JDBC limitation
- in some cases unnecessarily many database sessions are used (APEX_LISTENER 16 sessions, APEX_PUBLIC_USER 121 sessions, APEX_REST_PUBLIC_USER 105 sessions)
- scaling cannot be specified exactly because it does not depend on the number of competing users, but on the query result / page sizes
For many applications, the problem is also seen in the icon view in Apex Application Builder.
Is there another solution?
Answers
-
Hi,
just to clarify, how many concurrent users were hitting ORDS? The browser limits concurrent requests (see e.g. here https://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser) so it can not be a single developer who caused this (unless you ran into a bug, of course).
The ORDS team is working with us on reducing the number of required pool users. Already today, on ATP there is just a single session pool for ORDS_PUBLIC_USER (i.e. no APEX_LISTENER, APEX_PUBLIC_USER, APEX_REST_PUBLIC_USER). With a larger pool size for this single DB user, the same DB can serve more end users.
Regards,Christian
-
Hi Christian!
Thanks for the quick response!
how many concurrent users were hitting ORDS? 1 apex session
ords config:
perp01.xml
<entry key="db.username">APEX_PUBLIC_USER</entry>
<entry key="jdbc.InitialLimit">4</entry>
<entry key="jdbc.MinLimit">4</entry>
<entry key="jdbc.MaxLimit">256</entry>
perp01_al.xml
<entry key="db.username">APEX_PUBLIC_USER</entry>
<entry key="jdbc.InitialLimit">4</entry>
<entry key="jdbc.MinLimit">4</entry>
<entry key="jdbc.MaxLimit">256</entry>
perp01_pu.xml
<entry key="db.username">APEX_PUBLIC_USER</entry>
<entry key="jdbc.InitialLimit">4</entry>
<entry key="jdbc.MinLimit">4</entry>
<entry key="jdbc.MaxLimit">256</entry>
perp01_rt.xml
<entry key="db.username">APEX_PUBLIC_USER</entry>
<entry key="jdbc.InitialLimit">4</entry>
<entry key="jdbc.MinLimit">4</entry>
<entry key="jdbc.MaxLimit">256</entry>
Number of current database sessions
APEX_LISTENER 4
APEX_PUBLIC_USER 4
APEX_REST_PUBLIC_USER 4
ORDS_PUBLIC_USER 4
The link you sent read:
https://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser) :
2020 Update Number of parallel connections per browser:
| Browser | Connections per Domain | Max Connections | | -------------------- | ------------------------------ | ------------------------------ | | Chrome 81 | 6 [^note1] | 256[^note2] | | Edge 18 | *same as Internet Explorer 11* | *same as Internet Explorer 11* | | Firefox 68 | 9 [^note1] or 6 [^note3] | 1000+[^note2] | | Internet Explorer 11 | 12 [^note4] | 1000+[^note2] | | Safari 13 | 6 [^note1] | 1000+[^note2] |
--> Chrome 256 parallel connection per browser ...
If is default jdbc setting in ords config xml, you can easily reproduce the problem, you want select returning > 100 records on cards with images.
-
256 parallel connections in Chrome, but to different domains. In your example, all card image links would hit the same ORDS, i.e. Chrome should have tried to fetch 6 images concurrently.
I read the same db.username in your pools above. Is this a copy/paste issue or are you actually using the same DB user for each pool?
Regards, Christian
-
copy / paste issue
perp01.xml APEX_PUBLIC_USER
perp01_al.xml APEX_LISTENER
perp01_pu.xml ORDS_PUBLIC_USER
perp_01_rt.xml APEX_REST_PUBLIC_USER