X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 7179511F68C6; Fri, 21 Apr 2006 00:20:47 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.463 X-Spam-Level: X-Spam-Status: No, score=-2.463 required=5 tests=[AWL=0.137, BAYES_00=-2.599, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 9ym3q6X0vFUz; Fri, 21 Apr 2006 00:20:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from ausimss.pervasive.com (ausimss.pervasive.com [66.45.103.246]) by postgresql.org (Postfix) with ESMTP id ACF0711F66BE; Fri, 21 Apr 2006 00:20:38 -0300 (ADT) Received: from ausbayes2.aus.pervasive.com ([172.16.8.6]) by ausimss.pervasive.com with InterScan Messaging Security Suite; Thu, 20 Apr 2006 22:20:37 -0500 Received: from AUSOWA.aus.pervasive.com ([172.16.4.8]) by ausbayes2.aus.pervasive.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 20 Apr 2006 22:20:36 -0500 Received: from ausmailid.aus.pervasive.com ([172.16.4.64]) by AUSOWA.aus.pervasive.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 20 Apr 2006 22:20:35 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: Problem with SELECT FOR UPDATE NOWAIT Date: Thu, 20 Apr 2006 22:17:22 -0500 Message-ID: <4D27CB1096EF1C408F4BFAB0046EC7B608C1B2@ausmailid.aus.pervasive.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] Problem with SELECT FOR UPDATE NOWAIT Thread-Index: AcZk4QWQXNX6wKfFQK6JKIA+h2xWpgAERVUX References: From: "Jim Nasby" To: "Mathias Laurent" Cc: , X-OriginalArrivalTime: 21 Apr 2006 03:20:35.0559 (UTC) FILETIME=[8E1A4F70:01C664F2] X-Archive-Number: 200604/212 X-Sequence-Number: 21381 Please include the list in your reply so others can help. I'm also = adding -interfaces. You're still not showing exact errors, but I suspect this might be a = JDBC issue. Here's what I get: Session 1: decibel=3D# begin; BEGIN decibel=3D# select * from i where i=3D1 for update nowait; i=20 --- 1 (1 row) decibel=3D# begin; BEGIN decibel=3D# select * from i where i=3D2 for update nowait; i=20 --- 2 (1 row) decibel=3D# select * from i where i=3D1 for update nowait; ERROR: could not obtain lock on row in relation "i" decibel=3D# select * from i where i=3D3 for update nowait; ERROR: current transaction is aborted, commands ignored until end of = transaction block decibel=3D#=20 -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 -----Original Message----- From: Mathias Laurent [mailto:e1lauren@hotmail.com] No, it really occurs like that... The problem maybe become of the use of = the=20 driver jdbc because I pass through JAVA ! I do : Session 1 : BEGIN Select * FROM myTable WHERE num=3D3 FOR UPDATE NOWAIT Session 2 : I can do Select * FROM myTable WHERE num=3D4 FOR UPDATE NOWAIT Select * FROM myTable WHERE num=3D2 FOR UPDATE NOWAIT .... But When I do Select * FROM myTable WHERE num=3D3 FOR UPDATE NOWAIT =3D> error (Normal) But It blocks all the table "myTable" for the session 2 !!!!!! And for example i can't do : Select * FROM myTable WHERE num=3D2 FOR UPDATE NOWAIT If i want to do that, I must do a COMMIT (Then the table is available except for the : Select * FROM myTable WHERE num=3D3 FOR UPDATE NOWAIT ) Normal ;) Until = I do Session 1 COMMIT Then i don't see where is the problem ! Thank you for your answer, Mathias LAURENT >From: "Jim C. Nasby" >To: Mathias Laurent >CC: pgsql-admin@postgresql.org >Subject: Re: [ADMIN] Problem with SELECT FOR UPDATE NOWAIT >Date: Thu, 20 Apr 2006 17:47:38 -0500 > >I think you're confused about what actually happened... > >Session 1: >decibel=3D# select * from a; > i >--- > 1 >(1 row) > >decibel=3D# begin; >BEGIN >decibel=3D# select * from a for update nowait; > i >--- > 1 >(1 row) > >decibel=3D# > >Session 2: >decibel=3D# select * from a for update nowait; >ERROR: could not obtain lock on row in relation "a" >decibel=3D# select * from a for update; > >...waits... > >Session 1: >decibel=3D# rollback; >ROLLBACK >decibel=3D# > >And immediately in session 2: > i >--- > 1 >(1 row) > >decibel=3D# > >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=20 >clean, > > I would thus like to have your opinion. When I made with the process = 1 : > > > > Select * FROM myTable WHERE num=3D3 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@pervasive.com >Pervasive Software http://pervasive.com work: 512-231-6117 >vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 _________________________________________________________________ Tout savoir sur la s=E9curit=E9 de vos enfants sur Internet !=20 http://go.msn.fr/10-channel/80-security/protection/default.asp