ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
  • Enable management of pre-launched sessions
  • Correcting errors specific to pre-launched sessions
  • Enabling pre-launched sessions on the server
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
A pre-launched session is a Web site (or Web service) session launched automatically on the Web server from the WEBDEV Application Server.
The use of pre-launched sessions speeds up page display by anticipating time-consuming processes such as database connections and page configuration loading.
Pre-launched sessions can be used with:
  • WEBDEV sites in Session mode,
  • WEBDEV AWP sites,
  • SOAP web services and REST web services.
    New in version 2025
    For web services, it is also possible to use "pre-launched session recycling".
This operating mode is identical in any case.
Note Pre-launched sessions are only allowed on the unlimited server or 10 connections. 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 Active WEBDEV 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 Each time a request is made (and therefore each time a page is changed or an Ajax call is made), the WEBDEV Application Server reloads the project and re-executes 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.
New in version 2025
Additional option for web services:
In the case of web services, an additional option can be activated: recycling of pre-launched sessions.
If this option is enabled:
  • At the end of the web service call, the WEBDEV Application Server does not terminate the pre-started session associated with it.
  • The "Recycle a pre-launched session" event associated with the project is then executed. This event can, for example, reset variables or connections specific to the client that called the web service.
  • WEBDEV Application Server waits for connection to the web service (in pre-started session mode).
Implementation

Enable management of pre-launched sessions

To activate the management of pre-launched sessions:
  1. Display the description of the project configuration (of your site or web service):
    • In the "Project Explorer" pane, select the desired configuration.
    • From the context menu, select "Description".
  2. On the "Options" tab, check "Enable pre-launched sessions on the Application Server".
    New in version 2025
    For a web service, you can also activate connection recycling by checking the "Recycle pre-launched sessions" option.
  3. Validate. The project is recompiled.
To manage pre-launched sessions, several 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.
  • initialization in pre-launched session mode, executed when the WEBDEV Application Server processes the request.
  • New in version 2025
    the event "Recycling a pre-launched session" if session recycling has been requested for the Webservice configuration".
If your project configuration uses pre-launched sessions, certain functions can no longer be used in the project initialization code. The corresponding errors are displayed in the "Compilation error" pane.
Reminder: To display the "Compilation errors" pane, under the "Home" pane, in the "Environment" group, pull down "Panes" and select "Panes" then "Compilation errors".

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.
To correct errors specific to pre-launched sessions, simply move the corresponding code to the "Initialization when connecting to a pre-launched session" event.
When the site or web service is compatible with the pre-launched session mechanism, it can be deployed and pre-launched sessions activated on the WEBDEV Application Server.
The list of functions not to be used in project initialization code is as follows:
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 website.
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 web service 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 values will be persistent between successive displays of Active WEBDEV Pages.
DeclareWebserviceContextUsed to declare a list of variables whose value will be persistent between the successive calls to a web service.
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 feed and returns the content of the RSS feed 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 a file "uploaded" by the user to the server.
UploadFileNameReturns the name of a file "uploaded" by the Web user. This file must have been uploaded:
  • via an "Upload" edit control.
  • via a single-file or multi-file Upload field.
WebserviceClientIPAddressReturns the IP address of the computer using and calling the web service.
YesNoDisplays a message in a standard dialog box that proposes "Yes" and "No" and returns the user's choice.

Enabling pre-launched sessions on the server

To activate pre-launched sessions for a site or web service:
  1. Start the WEBDEV administrator.
  2. Go to the "Configuration" tab.
  3. Check "Allow pre-launched sessions.". By default, all the sites and web services have 0 pre-launched sessions.
  4. Select the site or web service to be configured ("Sites" tab or "Webservices" tab).
  5. In the site parameters ("Parameters" option in the "Sites" tab) or Webservice parameters ("Parameters" option in the "Webservices" tab), specify the maximum number of pre-launched sessions to be used.
  6. Validate.
Remarks:
  • Pre-launched sessions are counted in the total number of connections to the site (or to the web service). 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.
    • If a session takes longer than one second to (pre)launch, the number of pre-launched sessions actually available decreases.
  • New in version 2025
    Webservices with session recycling:
    • sessions are not recycled in the event of a problem (e.g. WLanguage error).
    • sessions can be recycled a maximum of 200 times. Beyond that, the usual system of pre-launched sessions is used.
    • the EnModeRecycling function lets you know whether the code currently being executed has been executed since the "Pre-launched session recycling" event.
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/13/2025

Send a report | Local help