In Uplink, is it safe to reset anvil.tables.AppTables.cache between connections? Is there a better way?

That’s exactly the library code that led me to try it.

It works, in a limited sense. But how many other variables in the library just happen to refer to the original cache object, out of convenience? Those other variables, if they exist, don’t get updated when we assign None to this one. Who knows what trouble might ensue with such inconsistencies?

Of course, our friends at anvil.works do know, and so they’d be the best ones to fix it (or tell us “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 in all cases. If that’s impractical, well, then it’s impractical; but then the documentation should eliminate that surprise.

1 Like