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
2009-03-27 09:35:15
+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
2009-03-27 14:52:59