467,219 Members | 1,293 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,219 developers. It's quick & easy.

Synchronize Access Database!!

Hi all.
I'm writting a multithreading program that will update a loacal Access
database.
I'm using OleDB connection to get access to the database from each
thread and my question is: how do I synchronize between threads\ how do
I lock the database so no clashes between threads occurs.
do I have to use a diffrent connection\adapters???

Jan 5 '06 #1
  • viewed: 2976
Share:
1 Reply
ta*******@gmail.com wrote:
Hi all.
I'm writting a multithreading program that will update a loacal Access
database.
I'm using OleDB connection to get access to the database from each
thread and my question is: how do I synchronize between threads\ how do
I lock the database so no clashes between threads occurs.
do I have to use a diffrent connection\adapters???


No provider will handle issues like that for you. There are many things
you could (or should) do if the threads are trying to update the same
data simultaneously:

-Keep track of what the threads are updating (sync'ing - not gonna get
in the deep details or how-to's here; there's various ways to sync
threads and such, well documented, and it tends to get a bit
complicated), also to minimize deadlocks and such
-Have code to handle the concurrency issues (it WILL happen no matter
how careful you are)
-Make sure you're using the optimal lock type
-Commit transactions to DB as quickly as possible (not lock things for a
long time) - MANY things you can do for this alone...
-perhaps use a better database - access isn't exactly a great db, but
this is one of those scenarios where it's especially lacking (several
concurrent connections, transactional/high integrity, heavy stress/load,
may need to scale significantly, need to minimize "locking time" and
query execution time, etc). Honestly, I'd look into SQL Server Express
or any other real RDBMS like PostgreSQL. Perhaps that's the very first
thing I would change, it's definitely not helping.

and I'm sure many many more things could be said about it, but that's a
good start.
Jan 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by premmehrotra@hotmail.com | last post: by
1 post views Thread by taleran58@gmail.com | last post: by
7 posts views Thread by Allison | last post: by
18 posts views Thread by surfrat_@hotmail.com | last post: by
21 posts views Thread by nihad.nasim@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.