Regarding database connections, I understand the following recommendations.
To increase scalability, keep the connection open for the shortest amount of time possible
and
Open and close your connection per business operation
But I wonder, whether this rule helps in anyway for a local database (SQL Server CE, Sqlite etc.) since the 'scalability' factor doesn't come into play. Since opening and closing a connection will take a small amount of time, isn't it better to keep the connection open when opening the application and closing the connection while closing the application? Or does it have any other side effect?
I suggest opening a connection to the database on launch and not use this for anything, and close this when the app shuts down. The will "warm up" the engine. Then create a new SqlCeConnection object per database call using the exact same connection string. This will keep you from trouble when using multiple threads.