How to enable long connection

To maintain the same database connection throughout the user session (similar to a native C/S application), you can enable the LongConnection database parameter.

For example:

DBParm = Database='nvo2csharp', Provider='SQLNCLI11', LongConnection=1

When LongConnection=1 is enabled, the installable cloud application maintains a long-running database connection for the entire session.

Best practices

  1. Adjust the transaction timeout

    If long connection is enabled, increase the transaction timeout value (120 seconds by default) to have the same interval as the session timeout value (3600 seconds by default). This is to prevent transaction timeout during the session. Because if the transaction times out, then a new database connection will be created, which means the temp table is not the same one. For how to set transaction timeout values, refer to Configure the timeout settings.

  2. Enable long connection only in the necessary transactions

    Long connection is not the recommended default under the PowerServer architecture. It is recommended that you enable the long connection only for transactions that require persistent connections. Other transactions should continue to use the default short-lived connections.