A man with a mission...

New SQLite

That’s right! Last night I landed the latest version of SQLite to trunk. While generally updating SQLite is not so new-worthy, this time it is. You see, SQLite 3.5.x brings about some really awesome changes that consumers can take advantage of. The most important one for Mozilla (as I see it so far) is the ability to have the shared cache accessible on multiple threads. That means we can use database connections on multiple threads now while using the same cache. We can also use them at the same time (before, you could use them on different threads, but they would not have the same shared cache, nor could you use them at the same time). To see all the neat changes that we can now use, please read the SQLite docs.

comments

4 Responses to “New SQLite”

  1. Robert Accettura on January 11th, 2008

    #4 on that list also looks interesting. BYOM (Bring Your Own malloc())

  2. Jesper Kristensen on January 11th, 2008

    I cannot see any changes. Did I misunderstood something or do MXR lag behind?

    http://mxr.mozilla.org/mozilla/source/storage/public/mozIStorageService.idl#87

    87 * Opening connections from more than one thread to the same database will
    88 * also CORRUPT YOUR DATABASE. All connections share the same sqlite cache,
    89 * and the cache is not threadsafe.
    90 *
    91 * The connection object returned by this function is not threadsafe. You must
    92 * use it only from the thread you created it from.

  3. Shawn Wilsher on January 11th, 2008

    @Jesper

    Er, no – that’s just me missing updating that :/

    I filed Bug 411976 about that.

  4. fredrik on January 12th, 2008

    I added a note for mozIStorageService::openDatabase() on DevMo re: the thread safe cache being on trunk. Feel free to change the wording if you feel it’s unclear in some way.