Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 6CC2A9FA241 for ; Fri, 1 Dec 2006 09:31:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 98818-05 for ; Fri, 1 Dec 2006 09:31:03 -0400 (AST) X-Greylist: delayed 00:16:54.576322 by SQLgrey-1.7.4 Received: from sulechow.net (sulechow.net [194.116.248.30]) by postgresql.org (Postfix) with ESMTP id 7DD419FA178 for ; Fri, 1 Dec 2006 09:31:08 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by sulechow.net (Postfix) with ESMTP id 37C8B41AB6A for ; Fri, 1 Dec 2006 14:14:13 +0100 (CET) Received: from sulechow.net ([127.0.0.1]) by localhost (sulechow [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18783-02 for ; Fri, 1 Dec 2006 14:14:13 +0100 (CET) Received: from [10.128.17.136] (firewall.max.com.pl [62.87.223.3]) by sulechow.net (Postfix) with ESMTP id F001B41AB60 for ; Fri, 1 Dec 2006 14:14:12 +0100 (CET) Message-ID: <45702B1A.4030401@sulechow.net> Date: Fri, 01 Dec 2006 14:16:10 +0100 From: Marcin Waldowski User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Locking on PGStream.ReceiveChar(PGStream.java:256) Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by mks-vir (http://www.mks.com.pl) at sulechow.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/15 X-Sequence-Number: 16247 Hello. JDBC version: 8.1-407 JDBC 3 PostgreSQL version: 8.1.5-1 for Windows Database encoding: UTF8 I observed a lock at at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:256) Thread dump: "Thread-1" prio=6 tid=0x02ea9008 nid=0x638 runnable [0x0388f000..0x0388f9e8] at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) - locked <0x10bc1d48> (a java.io.BufferedInputStream) at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:256) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1163) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) - locked <0x10bc1d98> (a org.postgresql.core.v3.QueryExecutorImpl) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340) at org.postgresql.jdbc2.AbstractJdbc2Connection.execSQLUpdate(AbstractJdbc2Connection.java:217) at org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.java:737) It looks like it wait forever for next char from database (but it never comes) at jdbc driver code: public int ReceiveChar() throws IOException { int c = pg_input.read(); if (c < 0) throw new EOFException(); return c; } It happens after about hour of our perfomance test (high workload - 50 threads are executing various short operations on database) In our aplication it lock at following code: connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); which is executed after taking connection from pool. It is possible that this code is executing serveral times for the same connection. What can I do to avoid this problem? Regards Marcin Waldowski