4D Blog

Home Tips How to define sleeping timeout for remote 4D applications

How to define sleeping timeout for remote 4D applications

September 28, 2021

Tips

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.

Example

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.

Discuss

Tags Deployment, Session, v19

Latest related posts

  • September 15, 2025

    Find the right spot in your 4D Write Pro document with AI

  • September 2, 2025

    Intelligent 4D Write Pro document analysis with AI

  • August 25, 2025

    ORDA – Constructor and touched event – Detailed behaviour through a network

Avatar
Damien Fuzeau
- Product Owner - Damien Fuzeau joined the 4D Product team in February 2019. As a Product Owner, he is responsible for writing user stories and translating them into functional specifications. His role also involves ensuring that the delivered feature implementations meet customer needs. Damien holds a degree in Software Engineering from the University of Nantes. He spent over 23 years at his previous company, first as a developer (discovering 4D in 1997), and later as Engineering Manager and Software Architect. The company was an OEM partner of 4D and deployed enterprise software based on 4D for thousands of users across hundreds of servers. Damien is therefore well-versed in 4D development and deployment in multilingual environments.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy