Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0A5691337B5A for ; Thu, 18 Nov 2010 01:26:31 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 61169-03 for ; Thu, 18 Nov 2010 05:26:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm5.bullet.mail.sp2.yahoo.com (nm5.bullet.mail.sp2.yahoo.com [98.139.91.75]) by mail.postgresql.org (Postfix) with SMTP id 37FCD1337B58 for ; Thu, 18 Nov 2010 01:26:22 -0400 (AST) Received: from [98.139.91.63] by nm5.bullet.mail.sp2.yahoo.com with NNFMP; 18 Nov 2010 05:26:21 -0000 Received: from [98.139.91.6] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 18 Nov 2010 05:26:21 -0000 Received: from [127.0.0.1] by omp1006.mail.sp2.yahoo.com with NNFMP; 18 Nov 2010 05:26:21 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 33844.36281.bm@omp1006.mail.sp2.yahoo.com Received: (qmail 37125 invoked by uid 60001); 18 Nov 2010 05:26:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1290057980; bh=Qq2GwbXptdwBRTBUIfgj+Xe78plAk9zaZXW1vFmvmNU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Rr9rqDBw53t90qYhFqTxipDjfTAuZdTYetXk8mVYo8It+aHv1UbZC/L1v8Qyn/jAs7gCxkpKj39v/q5os2E1FhKsJ7xzicIw2enTaLN06BbrkM1Lbf+kVcSGc6MgcHflFVAgM4ejFBaOFYJMyp5xZOUjoEjgogXnTLcqrH5nMdE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=jRYowBiOZv1jHIf5goI0nVI9bFIgfozsQUTsDmdxuIFqgfb6Q9flGF8WBLRYChhz+xaOt5GNwMj49vR2q7Gds713PzvxIANLonUH5lOvvwuHbwtGEzR/kJLeJfpNJ6gaeTwzSxdt49I9V8UXESyvCEBRfmeb2uEEbP3nnyEVPAw=; Message-ID: <604272.29775.qm@web113402.mail.gq1.yahoo.com> X-YMail-OSG: gCtrJkIVM1n78ZSBKydGrwqYWDTOZv8J0vfl4xOsQsTvsFC 2Wjfi3WLC80ihAnedXk9N19T3Cnst1u9wEtoQUDdmxGvYlJc41sEVyz7hPU8 MTrbt877cXXwk6ioJW_Ios.LhHWqx5_VMYoyzn6Yl12UHHcd_AnWy8gmb3lS tfsbTRzR8ihgExJKt9U66G4bQ19SBqzHuM2e0ekQfCuBZ7yFpkBg8JpOj2B1 8uogoJimGs0aIBacshnKlPqaRYebcONrvAB_BM5PNseKXlotIT_k25EfBJwa KHe1rrl2U101NekcEx.MfZR7h1lEpi2fwDnFx8USenerylk4_JH2AsZARk.5 z5pnFpdZjSLN4oGTq9IoEa167Jg-- Received: from [96.230.100.13] by web113402.mail.gq1.yahoo.com via HTTP; Wed, 17 Nov 2010 21:26:20 PST X-Mailer: YahooMailRC/504.5 YahooMailWebService/0.8.107.285259 References: <270369.52816.qm@web113412.mail.gq1.yahoo.com> <82k4kimq99.fsf@mid.bfk.de> Date: Wed, 17 Nov 2010 21:26:20 -0800 (PST) From: Michael Fork Subject: Re: PSQLException: The column name was not found in this ResultSet. To: Kris Jurka , Maciek Sakrejda Cc: pgsql-jdbc@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/45 X-Sequence-Number: 21166 I am using the Spring Batch project (http://static.springsource.org/spring-batch/) to complete a large, parallel job configured to run 10 threads. A org.springframework.batch.item.database.JdbcCursorItemReader object is used to open the recordset using TYPE_FORWARD_ONLY and CONCUR_READ_ONLY. I tried following the code but was unable to figure out exactly how the recordset object was accessed and where. It does sound like the root of the problem lies in Spring Batch not properly synchronizing access to a recordset object and they should address the issue there if possible. While I would like to see the issue in PostgreSQL JDBC driver addressed as it was the only problem I have encountered to date, I understand if it is not since there is no explicit thread safe guarantee around a recordset. Thanks. Michael ----- Original Message ---- From: Kris Jurka To: Maciek Sakrejda Cc: Michael Fork ; pgsql-jdbc@postgresql.org Sent: Sun, November 14, 2010 5:44:33 PM Subject: Re: [JDBC] PSQLException: The column name was not found in this ResultSet. On Sun, 14 Nov 2010, Maciek Sakrejda wrote: > But we're getting really off-topic. Samuel suggested that the > ResultSet interface does not guarantee thread safety (i.e., it does > not promise that any implementation will be synchronized). As Till > pointed out, the PostgreSQL implementation JDBC API *does* in fact > promise thread safety (which is fine--an implementation can offer > additional guarantees here, as per Hashtable and Map). This would > suggest that we do need the fix that Michael originally suggested. > > However--and I think this is the only real open issue--Florian pointed > out that the guarantees in the PostgreSQL JDBC docs could be > interpreted to mean that the PostgreSQL Connection is guaranteed to be > thread-safe while ResultSet is not (especially given the dicey > wasNull() issue). > The real question is how realistic/useful is the coding pattern in question. There are other known thread safety problems in the driver that have not been dealt with. For example two threads sharing a PreparedStatement, one executing it while the other is simultaneously calling setXXX on it. The driver could synchonize this, but you'd random behavior behavior depending on which call happened first. So no driver changes were made to help support this because it doesn't seem like a reasonable coding pattern. Perhaps Michael could provide some additional context regarding the application and why multiple threads are processing the same ResultSet. You can avoid wasNull problems by only using getObject, but you'd still need to synchonize the next() calls. And how much gain can you really get by parallel ResultSet reading? Kris Jurka -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc