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 AAFC9329F45 for ; Thu, 21 Oct 2004 16:03:38 +0100 (BST) 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 47109-09 for ; Thu, 21 Oct 2004 15:03:32 +0000 (GMT) Received: from smtp1.kodak.com (smtp1.kodak.com [192.232.121.200]) by svr1.postgresql.org (Postfix) with ESMTP id 8FE8732ABE9 for ; Thu, 21 Oct 2004 16:03:27 +0100 (BST) Received: from mailgate-w.kodak.com (mailgate-w.kodak.com [192.232.121.210]) by smtp1.kodak.com (8.11.3/8.11.1) with SMTP id i9LF3No04048 for ; Thu, 21 Oct 2004 11:03:23 -0400 (EDT) Received: from nodnsquery(150.103.207.4) by mailgate-w.kodak.com via csmap id 02b0fefc_237b_11d9_876f_003048245d58_3382; Thu, 21 Oct 2004 12:05:21 -0400 (EDT) Received: from ei.kodak.com (chicago [150.102.65.4]) by dragon.ei.kodak.com (8.11.0/8.11.0) with ESMTP id i9LF3Mf19493 for ; Thu, 21 Oct 2004 11:03:23 -0400 Message-ID: <4177CFBA.7040100@ei.kodak.com> Date: Thu, 21 Oct 2004 11:03:22 -0400 From: Paul Tomblin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: A couple of questions Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/214 X-Sequence-Number: 11319 I'm using Postgres from a RedHat RPM postgresql-jdbc-7.2.4-5.73 on an installed base of a few hundred RedHat 7.3 machines. (Upgrading to Fedora Core 2 is in the not-near-enough future.) For historical reasons, our Java code uses the /usr/share/pgsql/jdbc7.1-1.1.jar that comes in that RPM, even though there are three other jars with higher version numbers. On these systems, we have several programs that access the database, and some of them are multi-threaded. There is one table in particular that's giving me trouble. It has a bunch of configuration parameters stored as keys and values, with both the keys and values being character strings. The initial key/value pairs are loaded in at creation time, but they are frequently updated using "UPDATE sys_info SET VALUE = ? WHERE KEY = ?". cosdb=> \d sys_info Table "sys_info" Column | Type | Modifiers --------+------------------------+----------- key | character varying(50) | not null value | character varying(128) | Primary key: sys_info_pkey Occassionally, one of the programs will suddenly act like one of the keys disappeared. Either I'll get a null pointer exception in org.postgresql.jdbc2.ResultSet.next(ResultSet.java:116) or I'll get a NumberFormatException when parsing one of the values that should always be an integer. As far as I can tell, at the time this happens there are no other threads in that program updating the database in any way, although there is a distinct possibility that another program is doing so. So my questions to you: 1. Are there any known concurrency issues where one program is doing an UPDATE on a table when another program is doing a query on it? 2. If there are known problems, would putting the UPDATE in a transaction help? 3. What is the diffence between the various jdbc*.jar files in the RPM, and should I switch to one of the other ones? Thank you.