Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9F16D2E0050 for ; Wed, 20 Feb 2008 08:19:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 35056-02-5 for ; Wed, 20 Feb 2008 08:19:21 -0400 (AST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by postgresql.org (Postfix) with ESMTP id 069112E006C for ; Wed, 20 Feb 2008 08:19:19 -0400 (AST) Received: by py-out-1112.google.com with SMTP id d37so4437986pye.29 for ; Wed, 20 Feb 2008 04:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=WUfZBLRKS1HECOmStd7UAt6XjZ2tvjXtYOEO07J9w9w=; b=VtPQnbrynPyDcHXd6jseB/IkIZKoG+XElyLzyvfLEw4kHPmKLTqvXIYUpsMF41FIAsqmbeskgD62Lh4Ax7EtuBngk6UEc5vYpzVRaRyDnlr0aR/th5CFo7Qr9MhwnZx0rCKCqmk1selF+az5E1vVysImvZUyBRhKUTYJB3+szPc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=DPE4niY4Cj2sOlp71nNBghPC+kcCuQ0uHnLbyvvgY/dEhGPs1+vDecO7lQkfIGZcW38Li9yveY0RoshRs1SBpAcKGph1D45GvI3S49v+hu8XlycKyZlzjNuSlYq4zK/wwuuZ2GUx2TcIWs8kwvui02UJxVlYKpQPHyjc+9HUhkA= Received: by 10.35.27.1 with SMTP id e1mr9717892pyj.48.1203509959131; Wed, 20 Feb 2008 04:19:19 -0800 (PST) Received: from albook.local ( [69.207.169.30]) by mx.google.com with ESMTPS id w29sm10623541pyg.40.2008.02.20.04.19.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Feb 2008 04:19:17 -0800 (PST) Message-ID: <47BC1AC4.5010809@gmail.com> Date: Wed, 20 Feb 2008 07:19:16 -0500 From: Paul Tomblin User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Retrieving last InsertedID : INSERT... RETURNING safe ? References: <38245.1203500677@motionsponsor.com> <47BC0AF6.2060500@enterprisedb.com> <87prurrh87.fsf@mnc.ch> <55C92F71-0317-4E91-A092-C22A7A2F1FD8@fastcrypt.com> In-Reply-To: <55C92F71-0317-4E91-A092-C22A7A2F1FD8@fastcrypt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200802/160 X-Sequence-Number: 18367 Dave Cramer wrote: >> Well, that other solution is dangerous in case multiple inserts >> to that table are done concurrently; a quite common usage pattern >> with java web applications handling multiple HTTP requests with >> concurrent java threads.. >> > No it is not dangerous. It is the right way to do it. There is > absolutely no danger in using currval in this manner. Unless you have autocommit on. -- Paul Tomblin http://blog.xcski.com/ "Only a NAZI would try to invoke Godwin's [law] deliberately" - Jeff Gostin in a.s.r