ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Window editor and page editor / Page editor
  • Overview
  • Importance of pre-launched sessions
  • Principle of a request for displaying an Active WEBDEV Page
  • Benefit of pre-launched sessions
  • Implementation
  • Steps to follow
  • Enabling the detection of errors specific to pre-launched sessions
  • Correcting errors specific to pre-launched sessions
  • Enabling pre-launched sessions on the server
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
A pre-launched session is a session of a Web site (or webservice) automatically started on the Web server from the WEBDEV Application Server.
Pre-launched sessions are used to speed up the display of pages by performing long processes in advance: connecting to databases, loading page configurations, etc.
Pre-launched sessions can be used with WEBDEV sites in Session and AWP modes and with SOAP and REST webservices. This operating mode is identical in any case.
Remark: Pre-launched sessions are allowed on the unlimited server or on the 10-connection server. They are not enabled on the development computer.
Importance of pre-launched sessions

Principle of a request for displaying an Active WEBDEV Page

To understand the importance of pre-launched sessions (especially for Active WEBDEV Pages), let's take a look at the principle of Active WEBDEV Pages.
When a Web user performs a request from an AWP page, the following operations are performed:
  1. The request is transmitted from the browser to the Web server.
  2. The Web server studies the request.
  3. The Web server transmits the request to the WEBDEV application server.
  4. The WEBDEV Application Server:
    • loads the project corresponding to the page.
    • runs the project initialization code, then the page code.
    • returns the response to the Web server.
  5. The Web server returns the response to the browser.

Benefit of pre-launched sessions

When displaying an Active WEBDEV Page, each call to the WEBDEV Application Server is entirely independent.
Consequence: For each request (and therefore for each change of page, for each Ajax call), the WEBDEV Application Server re-loads the project and re-runs the initialization code. The project initialization code often runs "long" operations:
  • connecting to the database,
  • loading configuration files,
  • ...
The pre-launched sessions ask the WEBDEV Application Server to perform these operations in advance.
Therefore, when the request of the Web user reaches the WEBDEV Application Server, the application server only has to run the request and to return the result.
Using pre-launched sessions results in shorter response times, since part of the code is executed in advance. However, pre-launched sessions do not reduce server load (the code is still executed) and do not replace the optimization of initialization code.
Implementation

Steps to follow

To implement pre-launched sessions in a WEBDEV project:
  1. Enable the detection of errors specific to pre-launched sessions.
  2. Correct the errors by using the "Initialize project after connecting to the site" event.
  3. Enable pre-launched sessions on the WEBDEV Application Server.

Enabling the detection of errors specific to pre-launched sessions

If your project uses pre-launched sessions, some functions can no longer be used when initializing the project.
To know potential problems that may occur when using pre-launched sessions, simply enable the mode for detecting the errors specific to pre-launched sessions:
  1. Display the "Compilation errors" pane if necessary: on the "Home" tab, in the "Environment" group, expand "Panes", select "Panes", and then select "Compilation errors".
  2. In the pane of compilation errors, click .
  3. The list of errors is displayed.
Remark: The detection of errors can also be enabled from the description window of the current configuration:
  1. On the "Project" tab, in the "Project configuration" group, click "Current configuration".
  2. In the "Compatibility" tab, check "Display compilation errors specific to pre-launched sessions".
  3. Validate.
  4. The list of errors is displayed in the error pane.

Correcting errors specific to pre-launched sessions

The errors of pre-launched sessions indicate which WLanguage functions are not allowed in the "Initialization" project event.
These functions are:
ASPDisplayCalls an external ASP script and returns the result page in the current browser window.
BrowserIPAddressReturns the IP address of the client computer connected to the WEBDEV site.
BrowserNameReturns the name of the browser of the Web user ("user agent").
BrowserPlatformReturns the user's browser platform.
BrowserTypeReturns the type of browser used by the Web user.
BrowserVersionReturns the version of the browser used by the Web user.
CancelAWPContextDeletes from the AWP context a variable that was added by DeclareAWPContext.
CancelWebserviceContextDeletes from the webservice context a variable added by DeclareWebserviceContext.
CertificateClientInfoReturns information about the certificate used by the client computer.
ConfigureAWPContextConfigures the operating mode of the AWP context.
ConfirmDisplays a message in a standard dialog box that proposes "Yes", "No", "Cancel" and returns the user's choice.
ContextCloseCloses a page context.
ContextOpenOpens a new page context without returning the information to the browser.
CookieReadRetrieves the value of a cookie saved on the computer of Web user.
DeclareAWPContextUsed to declare a list of variables whose value will be persistent between the successive displays of Active WEBDEV Pages.
DeclareWebserviceContextUsed to declare a list of variables whose value will be persistent between the successive calls to a Webservice.
ExecuteDelayedProcedureRuns a delayed procedure (in the WEBDEV application server).
FileDisplayDisplays a file in the user's browser.
FramesetDisplayDisplays a WEBDEV frameset in the user's browser.
FramesetRefreshRefreshes a frameset displayed in the user's browser from the context on the server.
FramesetUseDisplays a WEBDEV frameset in the user's browser and closes all the current page and frameset contexts.
FreeAWPContextFrees the AWP context in advance (on disk) to allow the other call on the same AWP context to be processed in parallel.
GglConnectManages authentication on a Google server (via the "OAuth 2.0" authentication mode).
gpwOpenOpens the User Groupware login window or page.
IdentifierAWPContextReturns the identifier of AWP context.
ImageAreaReturns the number of the image area clicked by the Web user.
ImageXPosReturns the horizontal position (X) of the mouse cursor in relation to the specified Image control.
ImageYPosReturns the vertical position (Y) of the mouse cursor in relation to the specified Clickable Image control.
OKCancelDisplays a message in a standard dialog box that proposes "OK" and "Cancel" and returns the user's choice.
PageCloseDialogCloses the current page. This page was opened by PageDisplayDialog. A return value can be returned to the calling page.
PageDisplayDisplays a web page in the user's browser.
PageDisplayDialogDisplays a page in modal mode. This function is used to establish a dialog with the user. The page is displayed in the foreground while the opening page is displayed in the background, grayed by the DDW mechanism.
PageParameterReturns the value of a parameter passed to the current page.
PageRefreshRefreshes a page displayed in the user's browser from the context on the server.
PageUseDisplays a WEBDEV page in the user's browser and closes all page contexts currently open on the server.
PHPDisplayCalls an external PHP script and returns the result page in the current browser window.
rssDisplayBuilds a RSS stream and returns the content of the RSS stream to the client.
ScriptDisplayCalls an external script or page (.php, .asp, .mhtml or.mht) and returns the result page in the current browser window.
StringDisplayReturns a specific string (or a buffer) to the client browser in response to a request.
UploadCopyFileSaves on the server a file "uploaded" by the Web user. This upload may have been performed:
  • via an "Upload" edit control.
  • via a single-file or multi-file Upload control.
UploadFileNameReturns the name of a file "uploaded" by the Web user. This upload may have been performed:
  • via an "Upload" edit control.
  • via a single-file or multi-file Upload control.
WebserviceClientIPAddressReturns the IP address of the computer using and calling the Webservice.
YesNoDisplays a message in a standard dialog box that proposes "Yes" and "No" and returns the user's choice.
To manage pre-launched sessions, two events are associated with the project:
  • "Initialization", a project event run before the request reaches the WEBDEV Application Server. This code is run when starting the pre-launched session.
  • "Initialize project after connecting to the site", run when the WEBDEV Application Server processes the request.
To correct the errors specific to the pre-launched sessions, simply move the corresponding code into the "Initialize project after connecting to the site" event.
When the site is compatible with the mechanism of pre-launched sessions, you can deploy it and enable the pre-launched sessions on the WEBDEV Application Server.

Enabling pre-launched sessions on the server

To enable pre-launched sessions for a site:
  1. Start the WEBDEV administrator.
  2. Display the "Configuration" tab.
  3. Check "Allow pre-launched sessions.". By default, all the sites and webservices have 0 pre-launched sessions.
  4. Select the site or the webservice to configure ("Sites" tab ot "Webservice" tab).
  5. In the site parameters ("Sites" tab, "Parameters") or Webservice ("Webservices" tab, "Parameters"), specify the number of pre-launched sessions to use.
  6. Validate.
Remarks:
  • Pre-launched sessions are counted in the total number of connections to the site (or to the Webservice). This information must be taken into account when configuring the WEBDEV Application Server.
  • The number of pre-launched sessions to be defined depends on the server usage and the number of requests.
    • When a user logs in (sites in Session mode) or displays a page (AWP sites), the WEBDEV Application Server uses a pre-launched session of this application, if any. Otherwise, the WEBDEV Application Server launches a normal session, as if the site didn't have any pre-launched sessions.
    • The number of available pre-launched sessions is checked every second, per site. Therefore, the number of pre-launched sessions depends on the number of connections (Session mode) or the number of times a page is displayed (AWP sites) per second.
    • You must be aware of the time it takes to launch the pre-launched sessions: if it takes takes more than one second to (pre) launch a session, the number of available pre-launched sessions decreases.
Minimum version required
  • Version 20
Comments
Click [Add] to post a comment

Last update: 06/12/2023

Send a report | Local help