TeMPOraL / cl-sqlite

Common Lisp binding for SQLite
http://common-lisp.net/project/cl-sqlite/
72 stars 27 forks source link

MRU-cache is not thread safe #9

Open guicho271828 opened 8 years ago

guicho271828 commented 8 years ago

Around here: https://github.com/dmitryvk/cl-sqlite/blob/master/cache.lisp#L24 How I can disable it?

guicho271828 commented 8 years ago

perhaps I should get a handle from each thread.

dmitryvk commented 8 years ago

SQLite is itself non thread-safe w.r.t. single database handle (i.e., each thread should open its own handle to the database). So it does not make much sense to make the cache thread-safe. Each thread should open its own database handle.

guicho271828 commented 8 years ago

I agree. It worked with multiple database handles. I think giving a brief reference in the doc may be helpful.