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 A8BDA52800 for ; Mon, 20 Jun 2005 21:20:08 -0300 (ADT) 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 90065-04 for ; Tue, 21 Jun 2005 00:20:06 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 42D3052812 for ; Mon, 20 Jun 2005 21:20:00 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DkWUk-0002yT-7W; Tue, 21 Jun 2005 12:20:02 +1200 Message-ID: <42B75D2F.50407@opencloud.com> Date: Tue, 21 Jun 2005 12:19:59 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Akhil Srinivasan Cc: pgsql-jdbc@postgresql.org Subject: Re: prepareCall hangs References: In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/110 X-Sequence-Number: 13072 Akhil Srinivasan wrote: > CallableStatement proc = con.prepareCall("{ ? = call > \"insAccount\" ( ? ) }"); > > proc.registerOutParameter(1, Types.OTHER); > proc.setString(2,userName); > this.registerCallableStatementForCancel(proc); > logger.debug("registerCallableStatementForCancel(): exit"+userName); > /* another thread will call statement.cancel() if timeout exceeded*/ > proc.execute(); > this.unregisterCallableStatementForCancel(proc); > logger.debug("unregisterCallableStatementForCancel(): > exit"+userName); > ResultSet rset = (ResultSet)proc.getObject(1); > > Occasionally the prepareCall just hangs, as logging statements show that > it does not enter the execute(). I find this unlikely as prepareCall doesn't do any I/O or thread-related work. It could be getting stuck in a loop, but it seems odd that it would only happen intermittently. More likely seems to be that you have a problem in registerCallableStatementForCancel. Can you add more logging immediately before calling registerCallableStatementForCancel() to eliminate that possibility? Alternatively, can you get a thread dump (on Linux/Solaris, send a SIGQUIT to the Java process) when it hangs? That'd show us exactly where things have stopped. -O