Fin Springs wrote: > Is it possible to open multiple connections to an in-memory database? >
I'm pretty sure the answer is no. > I have an application that gets a db handle with > sqlite3_open(":memory"). If another thread in the application were to > make that same call, would it get the same handle, another handle to > the same in-memory database, or a handle to a new in-memory database? > > So far, I have been using a mutex in my application to share the > single handle, since concurrent accesses will be rare. However, I > would like to be able to support 2 transactions in parallel, which I > don't think I can do with a single connection - I get a nested > transaction error if I try (which makes sense). > Why do you need two transactions in parallel? In general only one connection can have a transaction open on a database at any time. Locking is used to serialize transactions. Even with two connections, you can't have two active transactions. The second will stall waiting for the first to complete. Dennis Cote _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users