Re: CF 2.0 multithread app accessing database

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: SQL Server 2005 high lock requests/second and CPU after application upgrade
    ... So what did you mean by 'upgrade' and why does that have the effect you see? ... Of course we know nothing about the architecture from your post so anything I say from here is speculation but the odd point is the number of connections. ... The application is possibly the most annoying app I've ever had the ... upgrade our CPU usage and lock requests per second have really shot ...
    (microsoft.public.sqlserver)
  • Re: Multithreaded file locking solution?
    ... No exceptions get thrown by the tryLock statement. ... What if it is a different Java process? ... If the lock is null, I continue to the next file. ... >> connections and have it assigns them round robin style to the parse ...
    (comp.lang.java.programmer)
  • Re: controlling lock order in transactions
    ... I checked my existing connections events in the profiler, ... I don't see anything about isolation level. ... only using transaction in stored procedures. ... I though it was always Exclusive lock. ...
    (microsoft.public.sqlserver.programming)
  • Re: CF 2.0 multithread app accessing database
    ... "Accessing a single SqlCeConnection from multiple threads, ... If I keep a "pool" of connections and the connections are used from ... has initiated a transaction at the same time as your sync thread. ... Providing Chris isn't using the same sqlce connection from both ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: SQL Server backend poor performance
    ... Everything works well with good response but when about 8-10 users are ... in the number of connections the whole system grinds to a halt. ... Using SQL Server links to populate ComboBox and ListBox RowSources is a good ... rows and then hold a lock on the table until the entire list is pulled. ...
    (comp.databases.ms-access)