PTW051: Understanding and Programming for the AppServer - PowerPoint PPT Presentation

1 / 47
About This Presentation
Title:

PTW051: Understanding and Programming for the AppServer

Description:

Typically started at system startup-time ... Activate/Deactivate (stateless & state-free) Specified when you configure ... Session-free. Returns unknown-value ... – PowerPoint PPT presentation

Number of Views:162
Avg rating:3.0/5.0
Slides: 48
Provided by: jamieto
Category:

less

Transcript and Presenter's Notes

Title: PTW051: Understanding and Programming for the AppServer


1
PTW-051Understanding and Programming for the
AppServer
  • Jamie Townsend
  • Technical Architect
  • Progress Switzerland

2
Understanding and Programming for the AppServer
Agenda
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

3
Architecture
4
Architecture
Any client
OpenEdge Application Server
Application Code
AppServer
Data
5
Architecture
Any client
OpenEdge Application Server
WebSpeed Transaction Server
Application Code
AppServer
Data
6
Components
AppServer Architecture
AppServer
Application Server Processes
Application Broker
Clients
NameServer
4GL Business Logic
Data
7
Components
Application Server Process
  • Executes OpenEdge 4GL procedures
  • Application Server processes are reused
  • Determined by AppServer operating mode

8
Components
Application Broker
  • Typically started at system startup-time
  • Manages pools of re-usable application server
    processes
  • Manages client requests for 4GL procedure
    execution

9
Components
NameServer
Location transparency
Inventory (A and B)
Clients
NameServer
10
Understanding and Programming for the AppServer
Agenda
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

11
Accessing the AppServer
  • Create server handle

CREATE SERVER hdl.
  • Connect to AppServer

Ret hdlCONNECT("-S 5353 -H pisces
-AppService Account").
  • Run procedures

RUN AccountBL.p ON SERVER hdl (INPUT
account-number).
  • Disconnect

ret hdlDISCONNECT().
  • Delete server handle

DELETE OBJECT hdl.
12
Connecting to the AppServer
How does it work?
ASInventory Hostzeus Port3097
hdlCONNECT("-H gemini -S 5162 -AppService
Inventory")
13
Running AppServer Procedures
14
Understanding and Programming for the AppServer
Agenda
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

15
AppServer 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

16
Session Models Operating Modes
Connection management
  • Session managed model
  • State-reset
  • State-aware
  • Stateless
  • Session-free model
  • State-free

17
Operating 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

18
Operating Modes state-aware state-reset
Session Managed Model
AppServer
Application Server Processes
Client 1
Client 2
Application Broker
NameServer
Data
Client 3
Client 4
19
Operating Modes stateless
Session Managed Model
AppServer
Application Server Processes
Client 1
Client 2
Application Broker
NameServer
Data
Client 3
Client 4
20
Operating 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

21
Operating 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
22
CONNECT()
  • 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

23
Session-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

24
Session-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

25
Resource Considerations
System Resources
Throughput
26
Programming Considerations
Server Responsiveness
Development Costs/ Time
27
Understanding and Programming for the AppServer
Agenda
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

28
Managing 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

29
Managing Context
30
Managing Context Session level
Available to state-aware and stateless
Startup Shutdown
31
Managing Context Connection level
Available to state-aware, state-reset, and
stateless
Connect Disconnect
32
Managing Context Request level
Available to stateless, unbound requests
Activate Deactivate
33
Managing 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

34
Managing 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

35
CLIENT-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

36
Managing 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

37
Understanding and Programming for the AppServer
Agenda
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

38
Running Remote Procedures
Standard AppServer calls - synchronous
Blocks the client during an active call
SynchronousAppServer
Request 1
Request 2
Total Processing Time

Client
39
Running 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
40
Example
  • Calling procedure

RUN BL.p ON SERVER hAppSrv ASYNCHRONOUS SET
hRq2 EVENT-PROCEDURE BL-evt-proc IN
THIS-PROCEDURE (INPUT-OUTPUT TABLE
order-table, OUTPUT iCount).
  • Event procedure

PROCEDURE BL-evt-proc DEFINE INPUT PARAMETER
TABLE FOR order-table. DEFINE INPUT PARAMETER
iCount as INT NO-UNDO.
41
ASYNC-REQUEST-COUNT()
  • Indicates outstanding requests

If hAppSrvASYNC-REQUEST-COUNT 0 THEN APPLY
CLOSE TO THIS-PROCEDURE.
42
CANCEL-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

43
Understanding and Programming for the AppServer
Summary Questions
  • Architecture
  • Accessing an Application Server Process
  • Operating Modes
  • Managing Context
  • Parallel Client Requests

44
Additional 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

45
Additional 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

46
Additional Information
Education www.progress.com/education
47
Thank you for your time!
48
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com