![]() | LoginProducts Sales Support Downloads About |
| Home » Technical Support » ElevateDB Technical Support » Technical Articles » Connections, Disconnections, and Reconnections |
Connections, Disconnections, and Reconnections
When using a remote session in a client application to connect to an ElevateDB Server, ElevateDB uses the operating system TCP/IP protocol support to perform all required communications to and from the ElevateDB Server. The TCP/IP protocol guarantees that any data stream sent either to or from an ElevateDB Server will arrive as a complete stream in the exact form that was sent. However, there is no way to guarantee that a given connection will be maintained indefinitely and not be interrupted by hardware or software issues that cause the connection to be lost. This article discusses how ElevateDB can handle such situations and how you can configure ElevateDB to optimally deal with them in the manner that you wish.
It is important here to make a distinction between sessions and connections. Sessions are an ElevateDB construct only and sessions can exist on an ElevateDB Server without an active connnection, as well as use several different connections over their lifetime. Connections, on the other hand, are simply the communications mechanism that remote sessions use to send requests to, and receive responses from, an ElevateDB Server.| Configuration Entry | Description |
| Server Session Timeout | Specifies how long the ElevateDB Server should wait for a request from a connected remote session before it disconnects the session. This is done to keep the number of concurrent connections at a minimum. Once a session has been disconnected by the ElevateDB Server, the session is then considered to be "dead" until either the remote session reconnects to the session in the server, or the server removes the session according to the parameters specified by the "Server Dead Session Interval", "Server Dead Session Expiration", and "Server Maximum Dead Sessions" configuration entries (below). A remote session may enable pinging in order to prevent the ElevateDB Server from disconnecting the remote session due to this configuration item. The default value is 180 seconds, or 3 minutes. |
| Configuration Entry | Description |
| Server Dead Session Interval | Specifies how often the ElevateDB Server will poll the disconnected sessions to see if any need to be removed according to the "Server Dead Session Expiration" or "Server Maximum Dead Sessions" configuration entries (below). The default value is 30 seconds. |
| Server Dead Session Expiration | Specifies how long a session can exist in the ElevateDB Server in a disconnected, or "dead", state before the server removes the session. This is done to prevent a situation where "dead" sessions accumulate from client applications whose network connections were permanently interrupted. If all of the remote sessions accessing the ElevateDB Server are using pinging, then you should set this property to the minimum value of 10 seconds so that sessions are removed as soon as they stop pinging the server.The default value is 300 seconds, or 5 minutes. |
| Server Maximum Dead Sessions | Specifies how many "dead" sessions can accumulate in the ElevateDB Server before the server begins to remove them immediately, irrespective of the "Server Dead Session Expiration" configuration entry (above). If the "Server Maximum Dead Sessions" configuration entry is exceeded, then the server removes the "dead" sessions in oldest-to-youngest order until the number of "dead" sessions is at or under the setting for this configuration entry. The default value is 64. |
| Type of Application | How to Configure |
| Delphi/C++Builder/Lazarus applications | The TEDBSession RemoteTimeout property |
| .NET applications | The TIMEOUT connection string attribute, or the EDBConnectionStringBuilder Class Timeout property. |
| ODBC applications | The TIMEOUT connection string attribute |
| Type of Application | What Happens |
| Delphi/C++Builder/Lazarus applications | If an event handler has been assigned to the TEDBSession OnRemoteTimeout event, then the event handler can decide whether or not to disconnect the remote session from the ElevateDB Server by assigning a value to the StayConnected parameter (default value is True). If no such event handler has been assigned, then the connection is closed for the remote session. In both cases an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate that the remote session has been disconnected. |
| .NET applications | If an event handler has been assigned to the EDBConnection OnTimeout event, then the event handler can decide whether or not to disconnect the remote session from the ElevateDB Server by assigning a value to the StayConnected property of the EDBTimeoutEventArgs parameter (default value is True). If no such event handler has been assigned, then the connection is closed for the remote session. In both cases an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate that the remote session has been disconnected. |
| ODBC applications | The connection is closed for the remote session, and an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate that the remote session has been disconnected. |
| Type of Application | How to Configure |
| Delphi/C++Builder/Lazarus applications | The TEDBSession RemotePing and RemotePingInterval properties |
| .NET applications | The PING and PINGINTERVAL connection string attributes, or the EDBConnectionStringBuilder.Ping and PingInterval properties |
| ODBC applications | The PING and PINGINTERVAL connection string attributes |
It is important that you set the ping interval to a value that is less than the value configured for the session timeout on the ElevateDB Server. Failure to do so will result in the pinging having no effect at all, since the timeout will occur before the ping request has a chance to reach the ElevateDB Server.| Type of Application | Information on How to Connect |
| Delphi/C++Builder/Lazarus applications | Connecting sessions |
| .NET applications | Use an EDBConnection Class object instance with connection strings or the EDBConnectionStringBuilder class. |
| ODBC applications | Connection strings |
| Type of Application | What Happens |
| Delphi/C++Builder/Lazarus applications | If an event handler has been assigned to the TEDBSession OnRemoteReconnect event, then the event handler can decide whether or not to reconnect the remote session to the session on the ElevateDB Server by assigning a value to the Continue and StopAsking parameters (default values are True and False, respectively). If no such event handler has been assigned, then the reconnection is automatically attempted once. If a reconnection fails, then an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate the failure. |
| .NET applications | If an event handler has been assigned to the EDBConnection OnReconnect event, then the event handler can decide whether or not to reconnect the remote session to the session on the ElevateDB Server by assigning a value to the Continue and StopAsking properties of the EDBReconnectEventArgs parameter (default values is True and False, respectively). If no such event handler has been assigned, then the reconnection is automatically attempted once. If a reconnection fails, then an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate the failure. |
| ODBC applications | The reconnection is automatically attempted once. If a reconnection fails, then an exception is raised with error code 1101 (EDB_ERROR_CLIENTLOST) to indicate the failure. |
| This web page was last updated on Friday, July 16, 2010 at 12:06 AM Valid HTML 4.01 Valid CSS | Privacy Policy Site Map© 2010 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |


