Re: Problem with SELECT FOR UPDATE NOWAIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think you're confused about what actually happened...

Session 1:
decibel=# select * from a;
 i 
---
 1
(1 row)

decibel=# begin;
BEGIN
decibel=# select * from a for update nowait;
 i 
---
 1
(1 row)

decibel=# 

Session 2:
decibel=# select * from a for update nowait;
ERROR:  could not obtain lock on row in relation "a"
decibel=# select * from a for update;

...waits...

Session 1:
decibel=# rollback;
ROLLBACK
decibel=# 

And immediately in session 2:
 i 
---
 1
(1 row)

decibel=# 

On Thu, Apr 13, 2006 at 01:57:47AM +0000, Mathias Laurent wrote:
> Hello,
> 
> Veiled I have a small problem which I have solved in a way not very clean, 
> I would thus like to have your opinion. When I made with the process 1 :
> 
> Select * FROM myTable WHERE num=3 FOR UPDATE NOWAIT
> 
> And that I remade it with a process 2 before having do one "Commit" It 
> blocked me (until there normal)
> But once that I free by doing one "Commit" with process 1 All the table 
> remains to block for process 2...
> To have access it, it is necessary that I do one "Commit" with the 
> processus2 !! It's very strange...
> 
> Thank you,
> 
> Mathias Laurent
> 
> _________________________________________________________________
> Windows Live Mail : d?couvrez et testez la version b?ta ! 
> http://www.ideas.live.com/
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>               http://www.postgresql.org/docs/faq
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@xxxxxxxxxxxxx
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux