[Tutor] Opening and closing SQLite db

Timo timomlists at gmail.com
Tue Dec 28 11:20:06 CET 2010


On 26-12-10 19:31, Noah Hall wrote:
>
>     >Which is suggestible just in case the app or program crashes
>     during use.
>
> (To O.P)
> Indeed, though in such cases you must rely on your programmers 
> instinct to make the right decision - what applies for certain 
> instances of an application doesn't always conform with what applies 
> for other instances. For example, committing every event is hardly 
> ideal for something such as a media player, but may be correct for 
> something handling vital data to the system.
The user gets some dialogs where he can click a save-button, so that 
looks like a perfect place to commit changes.

But to be sure, it is perfectly safe and valid to open the database on 
program startup, commit changes during the process and close it on exit 
(or unhandled exception)?

Cheers,
Timo


> There's no "one fits all feet" rule for such things - as you program 
> and develop more and more applications and programs, listen to your 
> users, and your bug tests. It'll come almost naturally after a while. 



More information about the Tutor mailing list