Re: CF 2.0 multithread app accessing database
- From: "Ginny Caughey MVP" <ginny.caughey.online@xxxxxxxxxxxxxx>
- Date: Mon, 2 Jun 2008 17:27:01 -0400
Doug,
It sounds like you understand things the way I do. Using different connections on different threads, he shouldn't need a lock at all for the connections. Your pool approach should work fine. What is not supported is using a single connection on multiple threads at the same time.
Ginny
"Doug" <joker@xxxxxxxxxxx> wrote in message news:ac5a7b24-5383-4d28-9eb3-1854abd7fc25@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Just want to get clarification on this statement. It doesn't seem
right.
"Accessing a single SqlCeConnection from multiple threads, even with
locks/monitors/critical sections isn't supported"
If I keep a "pool" of connections and the connections are used from
many different threads, but never used by more than a single thread at
a given time what problem does this cause and why is it not supported?
As for the Chris' statement:
"It works ok - I mean sometimes I am
getting info that: "cannot synchronize data. sql table is use by
other
process"
This seems normal to me. You just happen to hit a point when the user
has initiated a transaction at the same time as your sync thread. I
would say your code is working.
Lastly, some questions.
Providing Chris isn't using the same sqlce connection from both
threads, why does he need to use a lock at all? Is sqlce not capable
of handling more than 1 transaction at a time?
Thanks,
Doug
.
- References:
- Re: CF 2.0 multithread app accessing database
- From: Ginny Caughey MVP
- Re: CF 2.0 multithread app accessing database
- From: Doug
- Re: CF 2.0 multithread app accessing database
- Prev by Date: Re: How to intercept click on title bar X
- Next by Date: Re: TechEd in Orlando in a week or so
- Previous by thread: Re: CF 2.0 multithread app accessing database
- Next by thread: How to intercept click on title bar X
- Index(es):
Relevant Pages
|