X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5670B5638F for ; Thu, 3 Mar 2005 08:16:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80209-01 for ; Thu, 3 Mar 2005 08:16:02 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by svr1.postgresql.org (Postfix) with ESMTP id 8A4B256399 for ; Thu, 3 Mar 2005 08:16:01 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 68so484241wra for ; Thu, 03 Mar 2005 00:16:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:x-enigmail-version:x-enigmail-supports:content-type:content-transfer-encoding; b=iNt+ZfeKN5UzgevJ72Hgn26G/CaZ8dK9QIWMyTIuvhOA4FgCNDE5chZobxlfTFcMkx72qK5FbH2bb2DRHZuF5n+KMjMmVECuLo3pBS88zeTAiHSGllJ4XnRo8QZILEv2Z5c6XesUfBfsEo1S65TXF5zRq6OP0kjnc3ZhLmcL7Rc= Received: by 10.54.65.12 with SMTP id n12mr133850wra; Thu, 03 Mar 2005 00:16:02 -0800 (PST) Received: from ?138.232.9.34? ([138.232.9.34]) by smtp.gmail.com with ESMTP id g2sm324925wra.2005.03.03.00.16.02; Thu, 03 Mar 2005 00:16:02 -0800 (PST) Message-ID: <4226C7C4.6020002@gmail.com> Date: Thu, 03 Mar 2005 09:16:04 +0100 From: Mican Bican User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: jdbc mailinglist Subject: Re: lock problem when dont commit References: <915cd3880503021437382b001e@mail.gmail.com> <42264B3F.4080409@fastcrypt.com> <15017.1109806796@sss.pgh.pa.us> <42265BA3.7030509@fastcrypt.com> <15716.1109813069@sss.pgh.pa.us> In-Reply-To: <15716.1109813069@sss.pgh.pa.us> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.54 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200503/27 X-Sequence-Number: 12420 Tom Lane schrieb: >Dave Cramer writes: > > >>Tom Lane wrote: >> >> >>>Maybe a conflict on referenced foreign-key rows? >>> >>> > > > >>can you explain how that happens? >> >> > >When you insert or update a row in a table that has an FK reference, >it takes out a row-level lock on the referenced row in the master table. >This is needed to prevent someone else from deleting the master row >before commit. (Since the someone else can't see your uncommitted row, >nothing but a lock could stop them from thinking it's OK to remove the >master row.) > >So if two sessions are trying to insert rows that reference the same >master row, they conflict --- because the only type of row-level lock >we have at the moment is exclusive. I believe Alvaro is looking into >supporting shared row-level locks for 8.1, which'd make this problem >go away. > > regards, tom lane > > > Ok I think thats the problem.. because client1: ... conn.setAutoCommit(false) insert into liefAdress(adress,postcode) //id is autoincrement insert into liefAdress(adress2,postcode2) .... .... postcode is a FK to a list with postcodes. When I want insert different postcodes they are no locked.. there is only locked when the postcode are same. But why there are locked? Have anybody a good Idea to deal with this problem..?