Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 473F01337B5E for ; Mon, 8 Nov 2010 09:54:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 72465-10 for ; Mon, 8 Nov 2010 13:54:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm8.bullet.mail.sp2.yahoo.com (nm8.bullet.mail.sp2.yahoo.com [98.139.91.78]) by mail.postgresql.org (Postfix) with SMTP id 5A9A0133798E for ; Mon, 8 Nov 2010 09:54:33 -0400 (AST) Received: from [98.139.91.69] by nm8.bullet.mail.sp2.yahoo.com with NNFMP; 08 Nov 2010 13:54:31 -0000 Received: from [98.139.91.11] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 08 Nov 2010 13:54:31 -0000 Received: from [127.0.0.1] by omp1011.mail.sp2.yahoo.com with NNFMP; 08 Nov 2010 13:54:31 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 793498.31655.bm@omp1011.mail.sp2.yahoo.com Received: (qmail 54886 invoked by uid 60001); 8 Nov 2010 13:54:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1289224471; bh=QmuehtbJb8Ompy7i0qpzSMzM3APDqyTcIC6shdeBebo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=5rHDUXofBhYrGDYKOIHEcQ3iVux9OzV6RpvG0931URuvZzZSMhn3WWNxZ5hvqIyByKcnBqPvDgwxf5p30Rw7va4AEKuCptIULNUNbPVPrYmBSqurlNPUizSgdRyXdITS9HscEwXUS/QyU1VbCMBdDtbUIap3RV6jWHXKNB6EeZc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=FxkQlLH0YQVZp2ffF4RAcVEblhxDqB+JCIOiiLurecf9aEjJRv8kxebhWyCfHGOjhhHvOEgU8yBDUcuXISc/9MQBLMKdFhXSq8JCeUoevOosUHz8F/IjpUmSpzqNlyn9p/nFWT6aEg4Q/mbKzXdt+YAyLK0QxePVvegrGAGXuTQ=; Message-ID: <270369.52816.qm@web113412.mail.gq1.yahoo.com> X-YMail-OSG: Zf_DtAoVM1kfqlV1FltVJOc6qEv7hMFPwVluQYIF1CcMRy. uM4qC.VslsfAMqKU0_Zf.WePy.ddl1psyDEJZqJxF1_VwjGR9e7u1a0InpHk mdGEu_XHSZJvBET.nK1R13XsPe0EE8zu9mTHXFzUat6qEa3ha.UJm6NaEXQZ psQ6lJf8GP84Oh4V1ymcfYb2DE2MLBvlm5L_gsUC.0JiTIsIl3H6SiJV3KVc zKg70.bW2e7h4FZ0_NbKbAf5e_QvthzmGz2qPF7_juw.LqN9SU25WO2vtrsW dnzGPrgcrczAcV0aaWzvI_zQDJSM1aIPjor2kb3WQJUTdyCq5zdjxCedDnoG MuBopcMXy.efrokGe4bxTOMud Received: from [96.230.95.41] by web113412.mail.gq1.yahoo.com via HTTP; Mon, 08 Nov 2010 05:54:30 PST X-Mailer: YahooMailRC/504.5 YahooMailWebService/0.8.107.284920 Date: Mon, 8 Nov 2010 05:54:30 -0800 (PST) From: Michael Fork Subject: PSQLException: The column name was not found in this ResultSet. To: pgsql-jdbc@postgresql.org 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.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/11 X-Sequence-Number: 21132 postgresql-9.0-801.jdbc3.jar PostgreSQL 8.3.7 on amd64-portbld-freebsd7.2, compiled by GCC cc (GCC) 4.2.1 20070719 [FreeBSD] Caused by: org.postgresql.util.PSQLException: The column name mdn was not found in this ResultSet. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2562) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2405) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:225) I receive the above error message when accessing the JDBC resultset from multiple threads. It does not occur consistently, but roughly every 20 or 30 runs and almost immediately upon invocation. Looking at org/postgresql/jdbc2/AbstractJdbc2ResultSet.java it appears there is a race condition around building columnNameIndexMap if (columnNameIndexMap == null) { columnNameIndexMap = new HashMap(fields.length * 2); // The JDBC spec says when you have duplicate columns names, // the first one should be returned. So load the map in // reverse order so the first ones will overwrite later ones. for (int i = fields.length - 1; i >= 0; i--) { columnNameIndexMap.put(fields[i].getColumnLabel().toLowerCase(Locale.US), new Integer(i + 1)); } } I cannot confirm this, but I would guess that on thread enters, has the NULL map and creates the new HashMap. The second thread enters, sees the non-NULL columnNameIndexMap, and gets to the HashMap.get call prior to the first thread fully populating the map. If this is the problem, would wrapping the IF block in a synchronized(this) block fix it? Thanks. Michael