Behavior comparison

As explained in long-running connections vs. short-lived connections, features that depend on persistent database connections may fail to work in installable cloud apps.

Let's take the temp table as an example, to explain the behavior in the C/S app, and the behavior in the installable cloud app before and after enabling LongConnection:

  • Traditional C/S app -- A temp table remains available until the DISCONNECT statement is executed. Once created, the temporary table can be accessed by subsequent operations during the entire application session.

  • Installable cloud app -- When LongConnection is disabled (by default), connections are short-lived and managed by a connection pool. If a temp table is created in connection A, it will be destroyed when connection A is returned to the pool. Subsequent operations may use connection B which does not contain that temporary table. Even though connection A is picked again from the pool, it is not the same temporary table. As a result, operations that depend on the temporary table may fail (errors such as "table not found" will occur).

  • When LongConnection is enabled (LongConnection=1), the same database connection is reused throughout the user session, therefore, the temporary table remains active and accessible during the entire session, similar to the behavior of native C/S applications.