PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • 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, ...
Pre-launched sessions can be used with WEBDEV sites in Session and AWP modes and with WEBDEV 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.
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 event "Initializing the project after connection to the site".
  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 "Initializing" project event.
These functions are:
CancelAWPContextDeletes from the AWP context a variable that was added by DeclareAWPContext.
CancelWebserviceContextDeletes from the webservice context a variable added by DeclareWebserviceContext.
ASPDisplayCalls an external ASP script and returns the result page in the current browser window.
CertificateClientInfoReturns information about the certificate used by the client computer.
StringDisplayReturns a specific string (or a buffer) to the client browser in response to a request.
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 browser of Web user.
FramesetRefreshRefreshes a frameset displayed in the user's browser from the context on the server.
FramesetDisplayDisplays a WEBDEV frameset in the user's browser.
FramesetUseDisplays a WEBDEV frameset in the user's browser and closes all the current page and frameset contexts.
GglConnectManages authentication on a Google server (via the "OAuth 2.0" authentication mode).
gpwOpenOpens the login window or page of user groupware.
IdentifierAWPContextReturns the identifier of AWP context.
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.
ImageAreaReturns the number of the image area clicked by the Web user.
FreeAWPContextFrees the AWP context in advance (on disk) to allow the other call on the same AWP context to be processed in parallel.
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.
OKCancelDisplays a message in a standard dialog box that proposes "OK" and "Cancel" and returns the user's choice.
YesNoDisplays a message in a standard dialog box that proposes "Yes" and "No" and returns the user's choice.
PageRefreshRefreshes a page displayed in the user's browser from the context on the server.
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.
PageCloseDialogCloses the current page. This page was opened by PageDisplayDialog. A return value can be returned to the calling page.
PageParameterReturns the value of a parameter passed to the current page.
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.
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.
To manage pre-launched sessions, two events are associated with the project:
  • "Initializing", a project event run before the request reaches the WEBDEV Application Server. This code is run when starting the pre-launched session.
  • "Initializing the project after connection 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 event "Initializing the project after connection to the site".
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.
Remark: 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.
Minimum version required
  • Version 20
Comments
Click [Add] to post a comment