Title: PTW051: Understanding and Programming for the AppServer
1PTW-051Understanding and Programming for the
AppServer
- Jamie Townsend
- Technical Architect
- Progress Switzerland
2Understanding and Programming for the AppServer
Agenda
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
3Architecture
4Architecture
Any client
OpenEdge Application Server
Application Code
AppServer
Data
5Architecture
Any client
OpenEdge Application Server
WebSpeed Transaction Server
Application Code
AppServer
Data
6Components
AppServer Architecture
AppServer
Application Server Processes
Application Broker
Clients
NameServer
4GL Business Logic
Data
7Components
Application Server Process
- Executes OpenEdge 4GL procedures
- Application Server processes are reused
- Determined by AppServer operating mode
8Components
Application Broker
- Typically started at system startup-time
- Manages pools of re-usable application server
processes - Manages client requests for 4GL procedure
execution
9Components
NameServer
Location transparency
Inventory (A and B)
Clients
NameServer
10Understanding and Programming for the AppServer
Agenda
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
11Accessing the AppServer
CREATE SERVER hdl.
Ret hdlCONNECT("-S 5353 -H pisces
-AppService Account").
RUN AccountBL.p ON SERVER hdl (INPUT
account-number).
ret hdlDISCONNECT().
DELETE OBJECT hdl.
12Connecting to the AppServer
How does it work?
ASInventory Hostzeus Port3097
hdlCONNECT("-H gemini -S 5162 -AppService
Inventory")
13Running AppServer Procedures
14Understanding and Programming for the AppServer
Agenda
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
15AppServer Operating Mode
- Specified when AppServer is configured
- Determines how client requests dispatched to
individual Application Server processes - Design time considerations
- Design development of application
- Application context
- Performance Goals
- System resources, network response
- Request throughput and response time
16Session Models Operating Modes
Connection management
- Session managed model
- State-reset
- State-aware
- Stateless
- Session-free model
- State-free
17Operating Modes
Session Managed Model
- State-reset
- One client per Application Server process
- Session state is reset on disconnect
- State-aware
- One client per Application Server process
- Session state is maintained across connections
- Stateless
- Connection managed by AppServer Broker
- Many clients per application server process
- Context must be managed externally
18Operating Modes state-aware state-reset
Session Managed Model
AppServer
Application Server Processes
Client 1
Client 2
Application Broker
NameServer
Data
Client 3
Client 4
19Operating Modes stateless
Session Managed Model
AppServer
Application Server Processes
Client 1
Client 2
Application Broker
NameServer
Data
Client 3
Client 4
20Operating Modes
Session-free Model
- State-free
- No connection maintained between client and
AppServer process - Pooled connections
- 4GL requests on the server handle
- Web service requests on the WSA
- Requests dispatched similar to stateless except
- Multiple requests from one client run in parallel
- Each request runs independently
- Context must be managed externally
21Operating Modes state-free
Session-free Model
4GL Clients
AppServer
Application Server Processes
Client 1
Open Clients
Client 2
Application Broker
Web Service Client
Data
Web Services Adapter
Client 3
22CONNECT()
- Session-free connection
- Pool of re-usable socket connections
- AppServer handle points to pool
- Managed transparently by 4GL client
- Connections allocated as needed
- Tunable using CONNECT() properties
23Session-free
- Some applications not inherently connection
oriented - Requests executed regardless of other requests
- i.e. web page request for information
- Efficiency and Performance
- Parallel execution on any AppServer
- Efficient use of resources
- Performance gains
- Scalability
24Session-free
- Design considerations
- Procedures can execute concurrently
- Order of completion not predictable
- Persistent procedures
- Create a context
- Internal procedures execute
- On same AppServer
- Serially, losing parallel advantage
- Reduce scalability
25Resource Considerations
System Resources
Throughput
26Programming Considerations
Server Responsiveness
Development Costs/ Time
27Understanding and Programming for the AppServer
Agenda
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
28Managing Context
Configuration procedures
- 4GL procedures available to you to manage context
- Startup/Shutdown (state-aware stateless)
- Connect/Disconnect (all session managed modes)
- Activate/Deactivate (stateless state-free)
- Specified when you configure an AppServer
- Called automatically at the right time
29Managing Context
30Managing Context Session level
Available to state-aware and stateless
Startup Shutdown
31Managing Context Connection level
Available to state-aware, state-reset, and
stateless
Connect Disconnect
32Managing Context Request level
Available to stateless, unbound requests
Activate Deactivate
33Managing Context
stateless - bound / unbound
- To ensure all requests are directed to the same
AppServer process - Two ways to bind to a stateless AppServer
- Automatically
- Run a remote persistent procedure
- Dynamically
- Set SESSIONSERVER-CONNECTION-BOUND-REQUEST to
TRUE
34Managing Context
stateless
- Application specific context database
- Use SESSIONSERVER-CONNECTION-ID attribute
- Globally unique ID automatically set
- Recommended for an application specific context
db - Use Activate/Deactivate configuration procedures
to load/unload application context - Let the Application Broker do it
- Use SESSIONSERVER-CONNECTION-CONTEXT attribute
- Progress character string
- Set to last value assigned in context of
corresponding connection
35CLIENT-CONNECTION-ID attribute
- Session managed
- Character attribute on a server handle
- Returns connection ID string for the AppServer
connection - Session-free
- Returns unknown-value
- Logical connection to AppServer represented by a
pool of connections
36Managing Context
- Application specific context database using
SESSIONSERVER-CONNECTION-ID - Globally unique ID automatically set
- Recommended for application specific context db
- Use Activate/Deactivate configuration procedures
to Load/Unload context - Let the Application Broker do it
- SESSIONSERVER-CONNECTION-CONTEXT attribute
- Progress character string
- Set to last value assigned in context of
corresponding connection
37Understanding and Programming for the AppServer
Agenda
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
38Running Remote Procedures
Standard AppServer calls - synchronous
Blocks the client during an active call
SynchronousAppServer
Request 1
Request 2
Total Processing Time
Client
39Running Remote Procedures
AppServer calls - asynchronous
The client can make multiple calls to multiple
servers
RUN proc ON server ASYNCHRONOUS. . . .
Request 1
2
Total Processing Time
Client
40Example
RUN BL.p ON SERVER hAppSrv ASYNCHRONOUS SET
hRq2 EVENT-PROCEDURE BL-evt-proc IN
THIS-PROCEDURE (INPUT-OUTPUT TABLE
order-table, OUTPUT iCount).
PROCEDURE BL-evt-proc DEFINE INPUT PARAMETER
TABLE FOR order-table. DEFINE INPUT PARAMETER
iCount as INT NO-UNDO.
41ASYNC-REQUEST-COUNT()
- Indicates outstanding requests
If hAppSrvASYNC-REQUEST-COUNT 0 THEN APPLY
CLOSE TO THIS-PROCEDURE.
42CANCEL-REQUESTS() method
- Session managed
- Raises STOP for request currently running
- Purges send request queue of pending requests
- Session-free
- Raises STOP for ALL requests currently running
- Purges queued requests
43Understanding and Programming for the AppServer
Summary Questions
- Architecture
- Accessing an Application Server Process
- Operating Modes
- Managing Context
- Parallel Client Requests
44Additional Information
Other Exchange Sessions
- SOA-03
- Open Up Access to your 4GL Applications Using Web
Services - DEV-12
- Bridging the Microsoft and Progress Worlds with
the .NET Open Client - DONE-02
- Where Did You Go Wrong? Diagnostics and
Troubleshooting in OpenEdge - DONE-04
- Best Practices - Designing for Performance
These are a Few of My Favorite Tricks - DONE-08
- Sizing and Performance Tuning N-Tier Applications
45Additional Information
Documentation
- OpenEdge Documentation
- Getting Started
Application and Integration Services - Application Server
- Administration
- Developing AppServer Applications
- Development
- Open Client Introduction Programming
- Expert Series
- OpenEdge Revealed Achieving Server Control
with Fathom Management
46Additional Information
Education www.progress.com/education
47Thank you for your time!
48(No Transcript)