Re: [sqlite] Multiple connection to in-memory database
tmpfs looks like the best approach for us since we then can use concurrent transactions using multiple connections from different threads and with good performances. I didn't know /tmp was mounted as a tmpfs. Thanks all for the replies. Vincent Brandon, Nicholas (UK) wrote: >> I would like to use transactions from separate threads, each >> thread having one connection to a single in-memory db. >> >> > > If your production environment is a modern linux distribution you may > find the temporary directory ("/tmp") is already a memory drive using > the tmpfs filesystem. If not it is very easy to create one. Search the > internet for more information. > > You can then access the database by multiple processes/threads by > referring to the file path. > > Nick > > > This email and any attachments are confidential to the intended > recipient and may also be privileged. If you are not the intended > recipient please delete it from your system and notify the sender. > You should not copy it or use it for any purpose nor disclose or > distribute its contents to any other person. > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connection to in-memory database
This was the model that I was using. But I found out that I get a table lock for dropping tables for no reason when you do interleave steps for different prepares. Any body needs a proof I can create a test case for you. No I did not forget to do finalize for the prior prepares. The better way to do this is: attach ':memory:' as db2 attach ':memory:' as db3 You can do 10 of these puppies and possibly increase it to 32 or 64 depending on your CPU. Your main database can be ':memory:' as well. I am going to change my test script to see if the lock problem is solved. Thanks, -Alex On Tue, Aug 19, 2008 at 9:17 PM, Alex Katebi <[EMAIL PROTECTED]> wrote: > You don't need to open a second connection. The sole connection can be used > from any thread. > > > On Tue, Aug 19, 2008 at 6:17 PM, vincent cridlig <[EMAIL PROTECTED]>wrote: > >> Hi, >> >> I would like to use transactions from separate threads, each thread having >> one connection to a single in-memory db. >> >> I just read in the sqlite doc that in-memory sqlite databases (using >> sqlite3_open(":memory:", ...)) are private to a single connection. >> Is there a way to open a second connection to the same in-memory database >> (for example from a second thread)? Has someone ever tried to do (or >> implement) that? >> >> Any help appreciated. >> >> Thanks >> Vincent >> >> >> >> >> _ >> Envoyez avec Yahoo! Mail. Une boite mail plus intelligente >> http://mail.yahoo.fr >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connection to in-memory database
> > I would like to use transactions from separate threads, each > thread having one connection to a single in-memory db. > If your production environment is a modern linux distribution you may find the temporary directory ("/tmp") is already a memory drive using the tmpfs filesystem. If not it is very easy to create one. Search the internet for more information. You can then access the database by multiple processes/threads by referring to the file path. Nick This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connection to in-memory database
You don't need to open a second connection. The sole connection can be used from any thread. On Tue, Aug 19, 2008 at 6:17 PM, vincent cridlig <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to use transactions from separate threads, each thread having > one connection to a single in-memory db. > > I just read in the sqlite doc that in-memory sqlite databases (using > sqlite3_open(":memory:", ...)) are private to a single connection. > Is there a way to open a second connection to the same in-memory database > (for example from a second thread)? Has someone ever tried to do (or > implement) that? > > Any help appreciated. > > Thanks > Vincent > > > > _ > Envoyez avec Yahoo! Mail. Une boite mail plus intelligente > http://mail.yahoo.fr > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connection to in-memory database
You would need to implement your own custom vfs. On Tue, Aug 19, 2008 at 6:17 PM, vincent cridlig <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to use transactions from separate threads, each thread having > one connection to a single in-memory db. > > I just read in the sqlite doc that in-memory sqlite databases (using > sqlite3_open(":memory:", ...)) are private to a single connection. > Is there a way to open a second connection to the same in-memory database > (for example from a second thread)? Has someone ever tried to do (or > implement) that? > > Any help appreciated. > > Thanks > Vincent > > > > _ > Envoyez avec Yahoo! Mail. Une boite mail plus intelligente > http://mail.yahoo.fr > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Multiple connection to in-memory database
Hi, I would like to use transactions from separate threads, each thread having one connection to a single in-memory db. I just read in the sqlite doc that in-memory sqlite databases (using sqlite3_open(":memory:", ...)) are private to a single connection. Is there a way to open a second connection to the same in-memory database (for example from a second thread)? Has someone ever tried to do (or implement) that? Any help appreciated. Thanks Vincent _ Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users