SQLite, keep connection open or close every time?

Lynn Fredricks lfredricks at proactive-intl.com
Tue Nov 24 11:25:21 EST 2015


> IMHO always best to close after you are done. What if your 
> computer crashes? What if the network goes down? Closing the 
> connection ensures everything is tidied up. 

I agree with Bob, with any database. Also, sharing a local database among
multiple clients is sort of asking for it too. 

Also, what happens if multiple clients try to access it at the same time? I
actually see that a lot. Developers try to shave a buck off of their
licensing by using various tricks, and all they end up doing is putting
their client's data at risk.

Some databases have failsafes, like journaling, so that you don't lose too
much. Having regular hot back ups is also good. SQLite in itself doesn't do
what a networked server does (and one reason why we added SQLite Server to
Valentina Server).

But there aren't substitutes for common sense.

The amount of time it takes to open / close a database should really be
negligible on a "client only" solution. If your database is so huge
(multiple TBs) that its noticible, then it may be time to rethink your
strategy.

Best regards,

Lynn Fredricks
Paradigma Software
http://www.paradigmasoft.com

Valentina SQL Server: The Ultra-fast, Royalty Free Database Server 





More information about the use-livecode mailing list