Databases Reference
In-Depth Information
Lightweight : The instrumentation should be “non-intrusive” in terms of the load it introduces to the
process that it is measuring. The difference between timings when instrumentation is enabled and
disabled should be minimal, if measurable at all.
Integrated : Instrumentation should take advantage of any and all functionality that is built in to its
native environment—especially any functionality that will make problems easier to diagnose using
other tools within the environment.
As we examine APEX 4's debugging features in greater depth, you'll see that APEX adheres to these
precepts quite closely. We'll also discuss how you can extend instrumentation into your own code to
provide even more granular coverage than what APEX provides by itself.
Note The remainder of the chapter discusses APEX debugging directly, but I challenge you to think about the
aforementioned precepts and see how they are implemented in APEX, and how they may be implemented in your
own code.
Debugging Basics
To understand how debugging works, we need to take a quick tour of the core APEX engine. While this
might seem like an unnecessary review for many people, it's important due to changes in the way APEX
4 manages and logs debug information.
Page Processing and Rendering
An APEX application is basically a group of pages that are linked together via buttons, hyperlinks, tabs,
etc. When a user navigates through the application, submits data, or requests to view an APEX page,
there are actually two phases that the APEX engine goes through to provide the correct information back
to the user:
ACCEPT (Processing) : This phase acts upon the request made by the user and, if appropriate, runs
any defined validations, computations, processes and branches. This includes setting session state
and manipulating the underlying database tables.
SHOW (Rendering) : This phase executes all appropriate code to render the page that was identified
by the branch taken in the Processing phase. Page rendering may also contain computations,
processes and branches, as well as the visual components that make up the page to be rendered.
The reason these phases are important to debugging is that APEX breaks down the logging of debug
information into these same component parts. When the application server tier connects to the Oracle
database that contains the APEX installation, it grabs a connection from the database connection pool
and uses that to service the user's APEX request. You see this sequence in Figure 6-1.
 
Search WWH ::




Custom Search