SQLite, keep connection open or close every time?

Peter Haworth pete at lcsql.com
Wed Nov 25 16:19:12 EST 2015


Maybe I'm missing something but I don't understand why the issue of
concurrent users keeps coming up in threads about SQL dbs.  There are
perfectly good mechanisms built into every SQL implementation to preserve
the integrity of the db, that's ACID is all about, or at least the "I" in
it.  They require that correct programming techniques are used of course,
but without concurrency control, an SQL db would be pretty much useless.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Wed, Nov 25, 2015 at 1:09 PM, Bob Sneidar <bobsneidar at iotecdigital.com>
wrote:

> 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
>
>
> _______________________________________________
> 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