AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Editores / Editor de ventanas y páginas / Editor de páginas
  • 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
  • Webservices: "Recycling a pre-launched session" event
  • Enabling pre-launched sessions on the server
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
    Novedad versión 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 Every time a request is made (and therefore every 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.
Novedad versión 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 resumes waiting for connection to the web service (in pre-launched 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 "Activar sesiones preiniciadas en el servidor de aplicaciones".
    Novedad versión 2025
    For a web serviceit is also possible to activate connection recycling by checking the "Reciclar sesiones preiniciadas" option.
    This option offers the following benefits:
    • Reduced server resources: no need to create a session for each request.
    • Database optimization: a single connection is maintained instead of a new connection for each call.
    • Faster: the web service response is generated much more quickly.
  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.
  • Novedad versión 2025
    the "Pre-launched session recycling" event, if session recycling has been requested for the web service 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 "Inicio" pane, in the "Entorno" group, pull down "Paneles" 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:
ASPDisplayLlama a un script ASP externo y devuelve la página de resultados en la ventana actual del navegador.
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.
BrowserTypeDevuelve el tipo de navegador utilizado por el usuario de la Web.
BrowserVersionDevuelve la versión del navegador utilizado por el usuario de la Web.
CancelarAWPContextBorra del contexto AWP una variable añadida por DeclareAWPContext.
CancelWebserviceContextDeletes from the web service context a variable added by DeclareWebserviceContext.
CertificateClientInfoReturns information about the certificate used by the client computer.
ConfigureAWPContextConfigura el modo de funcionamiento del contexto AWP.
ConfirmDisplays a message in a standard dialog box that proposes "Yes", "No", "Cancel" and returns the user's choice.
ContextCloseCloses a page context.
ContextOpenAbre un nuevo contexto de página sin devolver la información al navegador.
CookieReadRetrieves the value of a cookie saved on the computer of Web user.
DeclareAWPContextSe utiliza para declarar una lista de variables cuyos valores serán persistentes entre sucesivas visualizaciones de Páginas WEBDEV Activas.
DeclareWebserviceContextUsed to declare a list of variables whose value will be persistent between the successive calls to a web service.
ExecuteDelayedProcedureEjecuta un procedimiento retardado (en el 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.
FreeAWPContextLibera el contexto AWP por adelantado (en disco) para permitir que la otra llamada en el mismo contexto AWP se procese en paralelo.
GglConnectManages authentication on a Google server (via the "OAuth 2.0" authentication mode).
gpwOpenAbre la ventana o página de inicio de sesión del Groupware Usuario.
IdentifierAWPContextDevuelve el identificador del contexto AWP.
ImageAreaDevuelve el número del área de imagen en la que ha hecho clic el usuario de la Web.
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.
PageCloseDialogCierra la página actual. Esta página fue abierta por PageDisplayDialog. Se puede devolver un valor de retorno a la página de llamada.
PageDisplayMuestra una página web en el navegador del usuario.
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.
PageUseMuestra una página WEBDEV en el navegador del usuario y cierra todos los contextos de página actualmente abiertos en el servidor.
PHPDisplayLlama a un script PHP externo y devuelve la página de resultados en la ventana actual del navegador.
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.
StringDisplayDevuelve una cadena específica (o un buffer) al navegador del cliente en respuesta a una petición.
UploadCopyFileGuarda un archivo "subido" por el usuario al servidor.
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.
YesNoMuestra un mensaje en un cuadro de diálogo estándar que propone la opciones "Sí" y "No", y devuelve la respuesta del usuario.
Novedad versión 2025

Webservices: "Recycling a pre-launched session" event

In the "Recycling a pre-launched session" event, it is essential to reset all global variables that were initialized in the "Initialization when connecting to a pre-launched session" event.
For example, if the customer's IP address is stored in a variable during a call, this variable must be emptied when the call is recycled. For example:
// -- Initialization in pre-launched session mode
// Retrieves the client's IP address
gsAdresseIP = WebserviceClientIPAddress()

// -- Recycle a pre-launched session
// reset client IP address
gsAdresseIP = ""

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 "Permitir sesiones preiniciadas.". 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.
  • Novedad versión 2025
    Webservices with session recycling:
    • session retraining is not carried out in the following cases:
      • a WLanguage error in the code.
      • thread (or parallel task) active after the response has been sent.
      • use of the EndProgram function.
    • sessions can be recycled a maximum of 200 times. Beyond that, the usual system of pre-launched sessions is used.
    • the InRecycleMode function lets you know whether the code currently being executed has been executed since the "Recycle pre-launched session" event.
Versión mínima requerida
  • Versión 20
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 04/04/2025

Señalar un error o enviar una sugerencia | Ayuda local