DVM_AVAILABLE

The DVM_AVAILABLE element specifies the interval of time (timeout) that the Genero Application Server (GAS) allows for the DVM to start. The GAS declares a timeout when this pre-defined interval passes without the DVM starting.

Syntax

<DVM_AVAILABLE>seconds</DVM_AVAILABLE>
  1. seconds specifies the interval of time (in seconds) allowed for the DVM to start. The default timeout is 10 seconds, set by the resource $(app.timeout.dvmavailable) for applications and $(ws.timeout.dvmavailable) for web services.

Child elements

There are no child elements.

Usage

Use this element to configure a timeout mechanism to handle the failure of the DVM to start. If the DVM has not started by the time the DVM_AVAILABLE timeout expires, the GAS sends an error message to the front-end and logs the message: DVM_AVAILABLE timeout expired

You might consider setting a timeout longer than 10 seconds to ensure it is not triggered too soon; however, 10 seconds is considered a long time to establish a connection. If a DVM does not connect within that time, it means there is an issue and increasing the timeout will only delay the response. Keep this in mind if you decide to increase the timeout; otherwise, use the default setting.

Usage example with app.timeout.dvmavailable resource

<DVM_AVAILABLE>$(app.timeout.dvmavailable)</DVM_AVAILABLE>
The default value of the resource $(app.timeout.dvmavailable) is 10 seconds. You can set a TIMEOUT with the resource:
<RESOURCE Id="app.timeout.dvmavailable" Source="INTERNAL">30</RESOURCE>
In this example, the timeout duration is set to 30 seconds, which means the GAS waits 30 seconds for the DVM to start before sending an error message to the front-end.
Using the resource has advantages over setting the timeout directly for the following reasons:
  • Shared resource: The resource is shared by other configuration components, ensuring that any changes automatically apply everywhere it is used.
  • Command line override: You can override the default value from the command line when starting the dispatcher by using the resource. For example: httpdispatch -E app.timeout.dvmavailable=60.

Usage example - use timeout directly

To set the timeout in your application configuration file (xcf), add a TIMEOUT element. In this example, the DVM_AVAILABLE duration is set to 30 seconds, which means the GAS waits 30 seconds for the DVM to start before sending an error message to the front-end.
<APPLICATION Parent="defaultwa">
   #...
   <TIMEOUT>
      <DVM_AVAILABLE>30</DVM_AVAILABLE>
   </TIMEOUT>
    #...
 </APPLICATION>

Web applications

When used as a child of the WEB_APPLICATION_TIMEOUT_COMPONENT element, the DVM_AVAILABLE timeout is only applicable when you start an application or you launch a sub process in interactive mode (IN LINE MODE). If you run the sub process in the background (IN FORM MODE), the DVM_AVAILABLE timeout is not applicable.

Web services

For a web service, there is no concept of a front-end; therefore, an error message is not sent. In addition, a web service is not expected to perform RUN commands with new DVMs connecting by themselves.

A slow database connection, for instance taking up to 10 seconds to reply, may trigger the DVM timeout. Therefore, ensure you start the service DVM before performing database operations. In the code sample, the call to start the service is performed before connecting to the database.
IMPORT com
IMPORT FGL myservice

MAIN
  CALL com.WebServiceEngine.RegisterRestService("myservice", "MyService")
  CALL com.WebServiceEngine.Start()
  DISPLAY "Server started"
  CONNECT TO "test1.db+driver='dbmsqt'"
  # ...
END

For more information on working with web services, see the Web services pages of the Genero Business Development Language User Guide.

Parent elements