Context Management (Magic xpa 3.x)

« Go Back


Created ByKnowledge Migration User
Approval Process StatusPublished

Context Management (Magic xpa 3.x)

The context management mechanism for the interactive Web application paradigm lets the program remain active between requests. The context mechanism includes the state of the Runtime engine, the Task tree, the database cursor Memory tables, and the I/O devices.


For the Space middleware, you can terminate a context using the Ctx* functions. However, you cannot terminate a context using the command line utility or the monitor.

Terminating a context is not recommended for either of the middlewares. It might leave resources locked.

Each context has its own identification, which is used to identify a context within the deployment environment.

The context is active until the program is closed, or until the Inactivity Timeout value expires. You can define the duration an inactive context remains active by setting a value in the Context Inactivity Timeout environment setting.


Once a context is created on a Magic xpa engine, all the requests from the client will always reach the same engine.

When using an external HTTP load balancer, you need to ensure stickiness between the client and the server, that is the ability of the load balancer to direct requests from each client to the Web server in which the initial request was created. To support this, each RIA request contains a header named MgxpaRIAglobalUniqueSessionID. This header keeps the same unique value in each HTTP request of a given end-user session. The header contains a different unique value for each client instance. External HTTP load balancers can use this to support stickiness.

Context variables maintain the context throughout a project when moving from one HTML form to another.

Use the Magic xpa GetParam function to check for the value of a context variable set in a previously called program.

Context Variables are implemented using either Cookies or Hidden Fields.

Related Topics