You are on page 1of 40

Disclaimer

This document in any form, software or printed matter, contains proprietary


information that is the exclusive property of Oracle. Your access to and use of
this confidential material is subject to the terms and conditions of your Oracle
Software License and Service Agreement, which has been executed and with
which you agree to comply. This document and information contained herein
may not be disclosed, copied, reproduced or distributed to anyone outside
Oracle without prior written consent of Oracle. This document is not part of your
license agreement nor can it be incorporated into any contractual agreement
with Oracle or its subsidiaries or affiliates.

This document is for informational purposes only and is intended solely to assist
you in planning for the implementation and upgrade of the product features
described. It is not a commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described in
this document remains at the sole discretion of Oracle.
Due to the nature of the product architecture, it may not be possible to safely
include all features described in this document without risking significant
destabilization of the code.
<Insert Picture Here>

Demystifying 11i Framework State Management


Barbara J. Waddoups
Senior Principal Instructor, ATG, Oracle University
barbara.waddoups@oracle.com
<Insert Picture Here>

What is “State Management”?


<Insert Picture Here>

Anatomy of a Framework
Page
What is a Framework Page?
Framework Page Breakdown
Page
–Root Region
•Items
–Buttons
–Fields
–Images
»Sub-regions
–Region
–Region
Terminology

• BC4J – Business Components for Java


Java packages/class files referenced in Oracle Applications and
built for custom applications
• AOL/J – Application Object Library for Java
Java packages/class files explicitly built for
securing/authenticating connections to Oracle Applications
• OC4J – Oracle Containers for J2EE
Core runtime J2EE components for Oracle Applications
Framework pages
• UIX – User Interface XML
Presentation components for rendering a Framework page
• OA Framework – “The Glue”
How Does A Page Get Displayed?

Read XML

Client
Http Request Read Class Files
Session
Session

Define Web Bean Hierarchy

HTML Returned via UIX

Web Bean
Hierarchy

Web Server
<Insert Picture Here>

Design Methodology
Model – View - Controller

Admin
Server
Controller
JAVA & XML

Oa.jsp
Oa.jsp
db
AM
AM

Model View
BC4J UIX
Model (cont)
VL (View Link)
•Links VOs
Model
EO (Entity Expert) VVO (Validation View Object)
•Encapsulates Data •Stores Composite Relationships
•Represents One Row •Used for validation
•Setters and Getters
•Data Integrity/Validation/Locking, Posting EE (Entity Expert Class)
•Created on Parent EO of composite relationship
VO (View Object) •References relationships for validation
•Represents Query & Data (all returned rows) •Cached in memory
•Builds (Instantiates) EO
•Contains pointers to EO Rows PVO (Property View Object)
•Tracks state of rendered property
AM (Application Module) •Used with Partial Page Rendering
•Container for VO’s •Contains a single row
•Controls DB Transaction (OADBTransaction)
Controller
AO (Association Object) CO
•Holds code for regions
AM •ProcessRequest – Get Action
•Links EO’s (master/detail)
•Setters and Getters VL
VO •ProcessFormData – Post Action
AO
PVO •ProcessFormRequest – Post Action
VO EO
EO
DB
VVO
View
VAM
•User Interface (UIX/OA Extensions)
•Instantiates files
•Reads Java & XML à HTML
Controller Actions
GET (ProcessRequest Method)
Validate à Fetch à AM à Instantiate à
User on App MDS Access to BC4J objects BC4J (some) & UIX
(XML & Java BC4J ) Transaction Context Build WebBean Hierarchy
Establishes DB Connect

Post Process à Render


Complex Bean Read JAVA & XML
Processing Build HTML
Populate Page

POST (ProcessFormData & ProcessFormRequest Methods)


Submit à Validate User à ProcessFormData à ProcessFormRequest à
Client-Side Possibly Retain Submit Form Detect Button Action
Validation State if needed Validate VO’s & EO’s Validate & Commit

Render Page
Read JAVA & XML
Build HTML
Populate Page
STATE
MANAGEMENT COMPONENTS
• Root Application Module <Insert Picture Here>

• Application Module Pooling and Passivation


• Servlet Session
• Application User Session
• Page Context
• Request
Conceptual View of State Management
Java Virtual Machine (JVM)

db Servlet Session WebAppsContext

Application State Application State


ICX SESSIONS
Uses
Table OA.jsp (servlet)
OADBTransaction
OAPageBean Application
State

OAPageContext
Application State

References
Caches Contains
Request
Application State <RootAppModule>AMImpl
<Insert Picture Here>

Root Application Modules


(Database Session and
Transaction State)
Root Application Module
• Each OA Framework page is associated with a root application
module.
• The root application module
• Provides transaction context
• Provides JDBC Database connection (In OA Framework, a database
session is associated with a JDBC connection).
• Caches the core application data (BC4J view objects, entity objects,
etc, and the web bean hierarchy) on the root application’s
oracle.apps.fnd.framework.OADBTransaction object.
• Provides accessibility to transaction data for all pages that share the
same root application instance (as long as the data is retained
between pages).
• Provides methods to retrieve, store and remove application data
within the root application module
• oracle.apps.fnd.framework.webui.OAPageContext (for controller)
• OADBTransaction (for model) classes.
Typical User Navigation/
Application Module Instantiation

Page A Page B
Request
Servlet
Session Navigates
Response

Uses Uses

Root Application Module Root Application Module


Page AAM Instance #1 Page BAM Instance #1
User Navigation/
Application Module Retention
Page A Page B
RetainAM=Y RetainAM=Y
Request
Servlet
Session Navigates
Response

Uses

Root Application Module


Task CAM Instance #1
When to Release/Retain Application
Modules
Multiple Page, Unrelated Tasks, Do Not Retain
Multiple Transactions Desired

Multiple Pages, Related Tasks, Single Retain


Transaction Desired

Multiple Pages, Different Tasks, Same Retain


BC4J Object

Multiple Pages, Related Tasks, Single Retain - for Multiple Pages. Page
Transaction with Page Branch to Branch will have it’s own AM. Use
Perform Discrete Task OAPageContext.releaseRootApplic
ationModule method to release AM
in the branch page
<Insert Picture Here>

Application Module Pooling


and Passivation
Root Application Module
Pooling/Passivation
User A JVM Session
begin1

end1 Root AM Pool Manager


begin2
PageA Root AM
AM - Instance 1
end2 Referenced Un-Referenced

begin1 AM -Instance 2
User B

Passivate
Reinstate
end1
<Insert Picture Here>

Servlet Session / Oracle


Application User Session
Servlet Session / Application User
Session ICX Sessions
Table
User
Session

WebAppsContext
Session
Session Cookie
Servlet

Servlet Servlet Servlet


4 2 3
<Insert Picture Here>

Page Context
Page Context - Simple Page Processing
Servlet Session

Page Page A
Http Page A
Context
Request
Http A
Response (Display Page)

Request/Page Boundary
Page Page B
Http Page B
Context
Request
Page Context - Complex Page Processing
Servlet Session

Page Page A
Http Page A
Context
Request

JSP Forward
Page Boundary

Page B

Http Page A Response

Request Boundary
<Insert Picture Here>

Request
HTTP Request – Page Context
Servlet Session
Http Page A Request Page
Context
• URL Parameters
• Form Field Data Values ( on POST)
•Web Bean/Event Name related for user selection (on
POST)
•Hidden Fields
•JSP Page Forwards
•Access Via:
•OAPageContext.getParameter*( ) Methods
•OAPageContext.putParameter Method
•OAPageContext.setForward*( ) Methods
<Insert Picture Here>

Profile Options
Profile Options - ICX

Profile Option Description Default/


Suggested
Setting
ICX: Limit Maximum user session in hours 4 / NA
Time

ICX: Session Maximum Idle Time for session in


Timeout minutes
Profile Options – Application Module

Profile Option Description Default/


Suggested
Setting
FND: Indicates whether AM Pooling is Yes/Yes
Application enabled. Disabling can create
Module Pool serious performance degradation.
Enabled
FND: How long the AM Pool Monitor can 300000/30
Application sleep prior to waking up and 0000
Module Pool destroying inactive root AM’s. Set (5 min)
Monitor Sleep time in milliseconds
Interval
Profile Options – Application Module

Profile Option Description Default/


Suggested
Setting
FND: The number of application module 10/10
Application instances the pool will create before
Module Pool passivating and recycling the
Recycle application modules for reuse.
Threshold
FND: The time-out period in milliseconds for 180000
Application available, inactive application /180000
Module Pool modules. (3 minutes)
Maximum
Inactive Age
Profile Options – Application Module

Profile Option Description Default/


Suggested
Setting
FND: The minimum number of available 0
Application application modules allowed per pool
Module Pool (low water mark).
Minimum
Available Size
FND: The maximum number of available 10
Application application modules allowed per pool
Module Pool (high water mark).
Maximum
Available Size
Profile Options – Application Module
Profile Option Description Default/
Suggested
Setting
FND: Indicates if passivation is enabled. None /
Passivation Valid values: None, Resource
Level Threshold, Request
FND: Session Used only if FND: Passivation Level No / No –
Timeout set to Resource Threshold or At
Recovery Request. Set to No until application Application
Enabled fully certified with Passivation Level
FND: Indicates whether the connection No/Yes
Application associated with an Application
Module module should be checked into the
Connection connection pool on AM checkin when
Pool Enabled application modules are pooled.
New Framework Application Module
Property Setting
AM Property Value Options Default/
Property Suggested
Setting
Retention RESERVE_FULL – Indicates that the root RESERVE_
Level AM is used exclusively for the current user FULL /
thread between requests. Does not MANAGE_S
guarantee state management during failover. TATE
MANAGE_STATE – Root AM and
connection can be released between
threads. AM is guaranteed to be preserved.
CONNECTION_AGNOSTIC – Connection
may be released between threads. Only use
if connection is not dependent on DB State
references (PL/SQL, Global Variables, etc)
Additional Information
http://education.oracle.com

11i Extend Oracle Applications: Extending OA Framework


Applications (E-Business Suite) 5 Days

11i Extend Oracle Applications: Customizing OA Framework


Applications (E-Business Suite) 4 Days

http:// www.oracle.com/technology/products/jdev/viewlets/viewlet.html

http://www.oracle.com/technology/index.html
References
Oracle Corporation. Oracle Applications Framework Technical Reference Release
11.5.10.2 “OA Framework State Management” , 2000 - 2005

Oracle Corporation. Application Development Framework Developer's Guide For


Forms/4GL Developers 10g Release 3 (10.1.3.0) “Understanding Why State
Management is Necessary”

Reilly, David. “State and session tracking with Java servlets, Part 1:
Using cookies”. <http://www.developer.com/tech/article.php/616801>

Reilly, David. “State and session tracking with Java servlets, Part 2:
Securing data”. <http://www.developer.com/tech/article.php/616831>

Flanagan, David. Java In A Nutshell, A Desktop Quick Reference.


O’Reilly Media, Inc., 2005

Oracle University. 11i Extend Oracle Applications: Building OA Framework


Applications. Ed 1.1, October 2005

You might also like