Env.: SQLCE Mobile 3.5 / WM6 / CF 2.0
Hi All,
My app makes extensive use of SQLCE.
User operations (foreground thread) use a connection object that stays alive
and opened all of the time for performances reasons (I tried to close the
connection after each access but testers immediately noticed the significant
slowdown).
The app also periodically starts temporary background threads that collect
info from the DB to send it to a server.
Q: Is it safe to use the same SqlCeConnection already used by the foreground
thread (Concurrent accesses by foreground and background threads WILL
occur)? Or should I use another object instance in the background threads?
Q: Is there any issue with keeping a connection opened all of the time
(memory usage, garbage collection of commands, whatever...)?
TIA for any lights you may shed.
Regards,
Serge.
Ginny Caughey MVP - 27 Nov 2008 12:38 GMT
Serge,
You should use a separate connection for each thread. Keeping the foreground
thread's connection open should not be a problem however unless a background
connection needs exclusive access to the database for compactions, etc.

Signature
Ginny Caughey
Device Application Development MVP
> Env.: SQLCE Mobile 3.5 / WM6 / CF 2.0
>
[quoted text clipped - 23 lines]
>
> Serge.
Serge Wautier - 27 Nov 2008 14:53 GMT
Ginny,
Thanks for your answer.
Serge.
> Serge,
>
[quoted text clipped - 30 lines]
>>
>> Serge.