Board index » delphi » DeadLock in a transaction (BDE + MS-SQL Server 6.5)

DeadLock in a transaction (BDE + MS-SQL Server 6.5)

Hello all,

I have a problem in a transaction.
First, I start a transaction(StartTransaction)
Second, I do insert a Row in a table(using TQuery).
Later on in the same transaction, I need to update that row
(using TQuery), but the update locks.

I can not see the reason why it locks.

Can anyone help me solving this problem.

Many Thanks.

Boubker

 

Re:DeadLock in a transaction (BDE + MS-SQL Server 6.5)


Boubker,
  When you execute the insert the record will be locked until it is
committed therefore executing an update on the same record will fail.
You will need to commit after the insert, start a new transaction and
then execute the update.

Jason.

Re:DeadLock in a transaction (BDE + MS-SQL Server 6.5)


Hi Jason!

On Fri, 31 Mar 2000 09:40:23 +0100, "Jason FitzHarris"

Quote
<jasf...@indigo.ie> wrote:
>  When you execute the insert the record will be locked until it is
>committed therefore executing an update on the same record will fail.
>You will need to commit after the insert, start a new transaction and
>then execute the update.

Record will be locked for other transactions, but not for same
transaction. If Boubker uses the same database component for both
Insert and update it should work because it's in the same transaction.

tomi.

Other Threads