Databases Reference
In-Depth Information
Connection Management
Three application server alternatives are available for Application Express:
Oracle HTTP Server (Apache)
Java Server (Glassfish or Web Logic Server) with the Oracle APEX Listener
Embedded PL/SQL gateway
The first and second options are recommended for high loads and production applications.
Configuration and setup of these are beyond the scope of this chapter; however, the basic asynchronous
architecture and connection pooling are important concepts.
A connection pool is a set of connections with a minimum and maximum number of connected
sessions defined. Each connection is connected as an unprivileged database user, typically
APEX PUBLIC USER . Each connection services a request and then is immediately available to service other
requests. Each connection is initialized before use and can handle any request from any workspace or
application. This asynchronous architecture does not support transactions that span requests; however,
the scalability is substantially better when compared with a synchronous connection architecture. As
discussed above, session state is maintained on the server side so logical sessions are maintained by
passing a session ID with each request.
Application Logging
To facilitate monitoring of application activity, each individual application page view is logged in a row
in a log table. This data is available as the APEX ACTIVITY LOG view. This view provides the elapsed page
generation time, user, application, page, workspace, report engine rows fetched, and other details.
APEX uses two identical log tables that are unioned together and exposed in APEX ACTIVITY LOG . The
APEX engine writes to one log table for two weeks, then switches and writes to a second identical table.
Two weeks later, it truncates the first table and writes to the first table. This provides between two and
four weeks of logged activity. Both page posts and page show events are recorded. Partial page rendering
is also recorded. The timestamp of the page view is indexed to enable efficient access to recent page
views.
The activity log is summarized daily and exposed as the view APEX ACTIVITY LOG SUMMARY . This
summary view provides an efficient way to view application usage and performance over time. It
contains one row for each active application for each day. Page view counts and other statistics are
aggregated. This view is never deleted from or purged.
Application developers and administrators interested in viewing activity log data can do so from the
workspace administration pages within APEX . Alternatively, they can write their own SQL queries
against the provided views, as shown in Listing 12-7. Reviewing the activity logs can be a productive way
to locate potential tuning opportunities.
Listing 12-7. Example SQL Query to Locate Popular Poorly Performing Pages
select to char(timestamp,'YYYY.MM.DD.HH24') hour,
application id,
page id,
count(*) page events,
sum(elap) eplased time,
count(*) * sum(elap) page weight
Search WWH ::




Custom Search