NT + deadlock intended behaviour ? - Mailing list pgsql-hackers

From Gaetano Mendola
Subject NT + deadlock intended behaviour ?
Date
Msg-id cd9j2b$38h$1@floppy.pyrenet.fr
Whole thread Raw
List pgsql-hackers
Hi all,
I'm doing some experiments with NT, I din't expect this behaviuor:


create table test ( a integer );
insert into test values (3);
insert into test values (4);
insert into test values (5);
insert into test values (6);



SESSION 1;                            SESSION 2;

begin;                              begin;
update test set a = 300 where a = 3;  update test set a = 40 where a = 4;                                      begin;
update test set a = 400 where a = 4;
<BLOCKED>                                      update test set a = 30 where a = 3;
<DEADLOCK DETECTED>                                      commit;
 
<UNBLOCKED>    <-- !?!?!                  <here I'm able to do another commit>

why SESSION 1 was unblocked ? If I repeat again but I do an abort:



SESSION 1;                            SESSION 2;

begin;                              begin;
update test set a = 300 where a = 3;  update test set a = 40 where a = 4;                                      begin;
update test set a = 400 where a = 4;
<BLOCKED>                                      update test set a = 30 where a = 3;
<DEADLOCK DETECTED>                                      abort;
 
<STILL BLOCKED>


Why that commit unblock the SESSION 1?


Regards
Gaetano Mendola










pgsql-hackers by date:

Previous
From: Gaetano Mendola
Date:
Subject: NT and aborted transaction
Next
From: Gaetano Mendola
Date:
Subject: unused variable