[sqlite] Multiple connections to in-memory database
I have an asp.net application. I open a sqlite in-memory connection with SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory: ); command. I read that by using cache=shared parameter, I can make that in-memory database reachable from other connections. 1.What is the way of applying cache=shared parameter in this type of connection? SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory:?cache=shared ); is not working? 2.What is the way of creating a new connection for accessing the previously opened in-memory database? Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connections to in-memory database
By trying I found out that SQLiteConnection(Data Source=:memory:;cache=shared); worked. In a single aspx.page at cs code, first I open an in-memory database connection SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory:;cache=shared ); conn.Open(); than create table and insert some data then without closing that connection open another connection in the sameway, but when I try to select the rows of the table that I created in the previous table, I get no such table error. What am I doing wrong??? From: Pavel Ivanov paiva...@gmail.com To: T Ü shocking_blue2...@yahoo.com; General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Thursday, July 5, 2012 3:21 PM Subject: Re: [sqlite] Multiple connections to in-memory database On Thu, Jul 5, 2012 at 7:46 AM, T Ü shocking_blue2...@yahoo.com wrote: I have an asp.net application. I open a sqlite in-memory connection with SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory: ); command. I read that by using cache=shared parameter, I can make that in-memory database reachable from other connections. 1.What is the way of applying cache=shared parameter in this type of connection? SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory:?cache=shared ); is not working? I think you should write SQLiteConnection(Data Source=file::memory:?cache=shared). But this possibility was introduced in SQLite 3.7.13. So your asp.net provider should be compiled with the latest version of SQLite, otherwise it won't work. 2.What is the way of creating a new connection for accessing the previously opened in-memory database? You should create new connection the same way as previously opened one, i.e. SQLiteConnection(Data Source=file::memory:?cache=shared). Pavel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connections to in-memory database
It returns 3.6.23.1 From: Pavel Ivanov paiva...@gmail.com To: T Ü shocking_blue2...@yahoo.com Cc: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Thursday, July 5, 2012 3:40 PM Subject: Re: [sqlite] Multiple connections to in-memory database On Thu, Jul 5, 2012 at 8:37 AM, T Ü shocking_blue2...@yahoo.com wrote: By trying I found out that SQLiteConnection(Data Source=:memory:;cache=shared); worked. In a single aspx.page at cs code, first I open an in-memory database connection SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory:;cache=shared ); conn.Open(); than create table and insert some data then without closing that connection open another connection in the sameway, but when I try to select the rows of the table that I created in the previous table, I get no such table error. What am I doing wrong??? Please execute SELECT sqlite_version() in your cs code and tell us the result of it. Pavel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multiple connections to in-memory database
Thank you so much Pavel. I will try with the new version. From: Pavel Ivanov paiva...@gmail.com To: T Ü shocking_blue2...@yahoo.com Cc: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Thursday, July 5, 2012 4:03 PM Subject: Re: [sqlite] Multiple connections to in-memory database So this feature shouldn't work for you. From my first message: But this possibility was introduced in SQLite 3.7.13. So your asp.net provider should be compiled with the latest version of SQLite, otherwise it won't work. Pavel On Thu, Jul 5, 2012 at 8:56 AM, T Ü shocking_blue2...@yahoo.com wrote: It returns 3.6.23.1 From: Pavel Ivanov paiva...@gmail.com To: T Ü shocking_blue2...@yahoo.com Cc: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Thursday, July 5, 2012 3:40 PM Subject: Re: [sqlite] Multiple connections to in-memory database On Thu, Jul 5, 2012 at 8:37 AM, T Ü shocking_blue2...@yahoo.com wrote: By trying I found out that SQLiteConnection(Data Source=:memory:;cache=shared); worked. In a single aspx.page at cs code, first I open an in-memory database connection SQLiteConnection conn = new SQLiteConnection ( Data Source=:memory:;cache=shared ); conn.Open(); than create table and insert some data then without closing that connection open another connection in the sameway, but when I try to select the rows of the table that I created in the previous table, I get no such table error. What am I doing wrong??? Please execute SELECT sqlite_version() in your cs code and tell us the result of it. Pavel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users