如何解决死锁问题(deadlock)
cqn 2000-09-10 11:05:00 we are doing a project .
In one Save button , we must do much work.
(1) update a record for table A
(2) delete a record for table A
(3) add a new record to table A
All these action use the one transcation .
For example:
conn.BeginTran
UpdateRecord.
DeleteRecord
AddNewRecord.
conn.committran
But when we click the save button at same time useing two different computer, the system will occur deadlock.
The Database is SQL Server 7.0 and Develop Tool is VB6.0
If we get rid of the transcation , the system is ok.
and if we move the DeleteRecord and AddNew to out of the transcation, the system is ok too.
But we can't do like it , because the system must have transcation.
Please give you advice, Thank you very much.