An Uplink program can, and sometimes should, connect to multiple Apps (or multiple versions of the same app), in sequence, e.g., to convey data from one to the next. See
for a concrete example, including a problem (stale table-definition cache) with the current implementation.
There are several clear ways to resolve this problem.
- Upon
anvil.server.disconnect()
, theanvil-uplink
package could “clear out” any stale data that could adversely impact [use of] the next connection.
a. Probably the same thing should happen if the connection is lost, or fails. - Alternatively, if performance is an issue, it might wait until the next
anvil.server.connect()
. - Document the limitation, and tell developers “don’t do that!”
The “principle of least surprise” says, whether it’s the Uplink program’s 101st connection or its 1st, the database access should work as documented. This suggests option 2 or 1. Option 3 is for the case where this cache-clearing is simply impractical.