In addition you should periodically call ReferenceManager.maybeRefresh(). While it's
possible to call this just before running each query, this is discouraged
since it penalizes the unlucky queries that do the reopen. It's better to use
a separate background thread, that periodically calls maybeReopen. Finally,
be sure to call ReferenceManager.close() once you are done.