To prevent session loss, 4D monitors the sleeping state of remote 4D applications.
When a user is connected from a remote 4D application to a 4D Server and their computer goes into sleep mode, the information is sent to 4D Server. At the moment the user’s computer wakes up, the remote 4D application then recovers its execution context.
Checking the STATE OF REMOte 4D applications
The sleeping state of a remote 4D application is displayed in the Server Administration window, in Users > Activity:
Another way to detect sleeping remote 4D applications is to use the Get process activity command:
$sleepingRemotes:=Get process activity (Sessions only).sessions.query(“state = :1”;”sleeping”)
HOW IT WORKs
While in sleeping mode, all resources consumed by the remote 4D are still allocated to it, to retrieve its working state when waking up. Processes, licenses, opened transactions, locked records, etc, are freed only when the remote 4D session ends.
To prevent sessions from remaining in sleeping mode for too long, 4D Server automatically closes all remote 4D sessions that have been asleep for more than 48 hours.
If you want to manage this timeout more precisely, depending on your customer’s usage, you can use the SET DATABASE PARAMETER command with the Remote connection sleep timeout selector. Note that the timeout shall be set in seconds and that the value is not stored, so you need to set your own timeout at the restart. It can even be set indifferently on the remote 4D and 4D Server, since the value takes effect only on the 4D Server side for all the remote 4D applications.
Sleeping checks for remote 4D applications are performed every 5 minutes on the 4D Server.
defaultTimeout:=Get database parameter(Remote connection sleep timeout) // 172800 seconds by default
SET DATABASE PARAMETER(Remote connection sleep timeout; 7200) // Set to 2 hours
Note: sleeping mode management is not available with the legacy network layer.