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

Session Session

Read Class Files

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 db
AM AM Oa.jsp Oa.jsp

Model
BC4J

View
UIX

Model (cont)
VL (View Link) •Links VOs

Model
EO (Entity Expert) •Encapsulates Data •Represents One Row •Setters and Getters •Data Integrity/Validation/Locking, Posting VO (View Object) •Represents Query & Data (all returned rows) •Builds (Instantiates) EO •Contains pointers to EO Rows AM (Application Module) •Container for VO’s •Controls DB Transaction (OADBTransaction) AO (Association Object) •Links EO’s (master/detail) •Setters and Getters
VO AM VL EO VO AO PVO EO CO

VVO (Validation View Object) •Stores Composite Relationships •Used for validation EE (Entity Expert Class) •Created on Parent EO of composite relationship •References relationships for validation •Cached in memory PVO (Property View Object) •Tracks state of rendered property •Used with Partial Page Rendering •Contains a single row

Controller
•Holds code for regions •ProcessRequest – Get Action •ProcessFormData – Post Action •ProcessFormRequest – Post Action

DB
VVO VAM

View
•User Interface (UIX/OA Extensions) •Instantiates files •Reads Java & XML à HTML

Controller Actions
GET (ProcessRequest Method)
Validate à
User on App

Fetch à
MDS (XML & Java BC4J )

AM à
Access to BC4J objects Transaction Context Establishes DB Connect

Instantiate à
BC4J (some) & UIX Build WebBean Hierarchy

Post Process à Render
Complex Bean Processing Read JAVA & XML Build HTML Populate Page

POST (ProcessFormData & ProcessFormRequest Methods)
Submit à
Client-Side Validation

Validate User à
Possibly Retain State if needed

ProcessFormData à ProcessFormRequest à
Submit Form Validate VO’s & EO’s Detect Button Action Validate & Commit

Render Page
Read JAVA & XML Build HTML Populate Page

STATE MANAGEMENT COMPONENTS
• • • • • • Root Application Module Application Module Pooling and Passivation Servlet Session Application User Session Page Context Request
<Insert Picture Here>

Conceptual View of State Management
Java Virtual Machine (JVM)

db
ICX SESSIONS Table

Servlet Session Application State

WebAppsContext Application State Uses

OA.jsp (servlet) OADBTransaction OAPageBean Application State

OAPageContext Application State

References Caches Request Application State <RootAppModule>AMImpl Contains

<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 Servlet Session Response Request Navigates Page B

Uses

Uses

Root Application Module Page AAM Instance #1

Root Application Module Page BAM Instance #1

User Navigation/ Application Module Retention
Page A RetainAM=Y Servlet Session Response Request Navigates Page B RetainAM=Y

Uses

Root Application Module Task CAM Instance #1

When to Release/Retain Application Modules
Multiple Page, Unrelated Tasks, Multiple Transactions Desired Multiple Pages, Related Tasks, Single Transaction Desired Multiple Pages, Different Tasks, Same BC4J Object Multiple Pages, Related Tasks, Single Transaction with Page Branch to Perform Discrete Task Do Not Retain

Retain

Retain

Retain - for Multiple Pages. Page Branch will have it’s own AM. Use 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
begin1 end1 begin2 end2

JVM Session

Root AM Pool Manager PageA Root AM
AM - Instance 1
Referenced Un-Referenced

User B

begin1

AM -Instance 2

end1

Reinstate

Passivate

<Insert Picture Here>

Servlet Session / Oracle Application User Session

Servlet Session / Application User Session ICX Sessions
User Session

Table

WebAppsContext Session
Session Servlet

Cookie

Servlet 4

Servlet 2

Servlet 3

<Insert Picture Here>

Page Context

Page Context - Simple Page Processing
Servlet Session
Http Page A Request Page Context Http A Response (Display Page) Page A

Request/Page Boundary
Page Http Page B Request Context Page B

Page Context - Complex Page Processing
Servlet Session
Http Page A Request Page Context Page A

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 4 / NA

ICX: Limit Time ICX: Session Timeout

Maximum user session in hours

Maximum Idle Time for session in minutes

Profile Options – Application Module

Profile Option Description

Default/ Suggested Setting Yes/Yes

FND: Application Module Pool Enabled FND: Application Module Pool Monitor Sleep Interval

Indicates whether AM Pooling is enabled. Disabling can create serious performance degradation. How long the AM Pool Monitor can sleep prior to waking up and destroying inactive root AM’s. Set time in milliseconds

300000/30 0000 (5 min)

Profile Options – Application Module
Profile Option Description Default/ Suggested Setting 10/10

FND: Application Module Pool Recycle Threshold FND: Application Module Pool Maximum Inactive Age

The number of application module instances the pool will create before passivating and recycling the application modules for reuse.

The time-out period in milliseconds for 180000 available, inactive application /180000 modules. (3 minutes)

Profile Options – Application Module
Profile Option Description Default/ Suggested Setting 0

FND: Application Module Pool Minimum Available Size FND: Application Module Pool Maximum Available Size

The minimum number of available application modules allowed per pool (low water mark).

The maximum number of available application modules allowed per pool (high water mark).

10

Profile Options – Application Module
Profile Option Description Default/ Suggested Setting None /

FND: Passivation Level FND: Session Timeout Recovery Enabled FND: Application Module Connection Pool Enabled

Indicates if passivation is enabled. Valid values: None, Resource Threshold, Request Used only if FND: Passivation Level set to Resource Threshold or Request. Set to No until application fully certified with Passivation Indicates whether the connection associated with an Application module should be checked into the connection pool on AM checkin when application modules are pooled.

No / No – At Application Level No/Yes

New Framework Application Module Property Setting
AM Property Retention Level Property Value Options Default/ Suggested Setting RESERVE_ FULL / MANAGE_S TATE

RESERVE_FULL – Indicates that the root AM is used exclusively for the current user thread between requests. Does not guarantee state management during failover. 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

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.