SQLite, keep connection open or close every time?
Bob Sneidar
bobsneidar at iotecdigital.com
Wed Nov 25 16:09:20 EST 2015
A memory database won't time out and close the connection, so those you don't have to worry about closing. Also, a memory database can only be used by one person by the nature of what it is so you won't have concurrent write problems.
A memory database is an exception, and for obvious reasons should only be used as a temporary database.
Bob S
> On Nov 24, 2015, at 12:42 , Richard Gaskin <ambassador at fourthworld.com> wrote:
>
> Dr. Hawkins wrote:
>> Doesn't a :memory: database get deleted by live code when closed.
>
> I would assume that any memory structure goes away when the process using it is completed.
>
>
>> And as I discovered playing around with sqlite, multiple potential users
>> can be a *real* problem.
>>
>> If a second user tries to open it, it appears to work. It may even work if
>> only one writes, but once there is a write, it gets strange.
>
> In his book Using SQLite, Jay A. Kreibich says that SQLite DBs can be read by any number of concurrent users, but can only be written to by one at a time, with a further caveat that SQLite itself doesn't impose restrictions on writes, so preventing concurrent writes is, as with most files, up to the application.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list