Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Benjamin Savs
Thanks for the hint. Using a separate data context for the other thread
solves the problem. But it doesn't make the situation much better, because
the data context seem to have separate cashes. So it does not help to cash
stuff in the background, because it won't be ready for the main thread
anyways.
But I think I found an answer for my original question. Thanks!

On Thu, Jul 7, 2011 at 12:12, Joe Mistachkin  wrote:

>
> I do not see anything obviously wrong with using the same connection
> to construct two or more LINQ data contexts; however, my knowledge of
> LINQ and its use of threads is somewhat limited.
>
> --
> Joe Mistachkin
>
> ___
> 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] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Joe Mistachkin

I do not see anything obviously wrong with using the same connection
to construct two or more LINQ data contexts; however, my knowledge of
LINQ and its use of threads is somewhat limited.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Benjamin Savs
I probably am using a single SQLiteDataReader, although I
never explicitly handle one.

context = new DataContext(_connection);

context.GetTable();

I do all queries on such a table object via Linq. Is there a way to
control the DataReader involved with such a query?


On Thu, Jul 7, 2011 at 11:06, Joe Mistachkin  wrote:

>
> Benjamin Savs wrote:
> 
> If I run Linq-queries from several threads I will get an exception that
> states
> "*DataReader has been closed*". Is this normal or should there be a way to
> issue
> concurrent reads?
> 
>
> Are you trying to share a single SQLiteDataReader object instance between
> threads
> or just the underlying database connection?
>
> The SQLiteDataReader class is not thread-safe and should not be shared
> between
> threads.
>
> --
> Joe Mistachkin
>
> ___
> 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] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Joe Mistachkin

Benjamin Savs wrote:

If I run Linq-queries from several threads I will get an exception that
states
"*DataReader has been closed*". Is this normal or should there be a way to
issue
concurrent reads?


Are you trying to share a single SQLiteDataReader object instance between
threads
or just the underlying database connection?

The SQLiteDataReader class is not thread-safe and should not be shared
between
threads.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users