tags:

views:

464

answers:

2

I will connect with one database from several machines. In all machines they need to insert the data in single table. In that time: how to use multithreading and deadlock concepts? Using the MySQL database and also MS Access.

A: 

If you are talking about an SQL server (MySQL) then the thread safty is not your problem. It's hard to tell what you are talking about. A bit more information would be nice!

Petoj
+1  A: 

The easiest way to avoid these issues is to use proper locking/coding techniques:

eg:

updating a value in a field use:

UPDATE table SET data=data+23 WHERE id=7

and not

@data = SELECT data FROM table WHERE id=7
@data = @data + 23
UPDATE table SET data=@data WHERE id=7

or use transactions, it really depends on what you are trying to do. If you want to exand your question a little, I can try to give you more examples.

sfossen