pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Akhil Srinivasan <akhilss@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: prepareCall hangs
Date: Mon, 20 Jun 2005 21:45:10 +0530
Message-ID: <ad76b9f205062009157b83571e@mail.gmail.com> (raw)

Hi
I have a an application that uses a lot of stored functions, some of them 
which create temporary tables and refcursors that point to the tables. 
Something that comes up occasionally are errors like 

the jdbc code looks like 
Connection con = poolingDataSource.getConnection();
con.setAutoCommit(false);
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(). The called procedures may or may not user 
temporary tables. But the functions hang just the same. 
Is there anyway i can avoid the hang condition or the next best thing some 
king of time out mechanism. I have one setup in the event that execute 
hangs. But i cannot think of how to cancel a prepareCall().

The application has a commons-dbcp maintaining a connection pool to the 
database server. The jdbc driver used is the jdbc3. The database version is 
7.4.5. It has been deployed on a Debian Linux system with kernel version 
2.6.8. 

Thanks
Akhil Srinivasan

view thread (3+ messages)  latest in thread

Message-ID: <ad76b9f205062009157b83571e@mail.gmail.com>
Permalink:  ../ad76b9f205062009157b83571e@mail.gmail.com/
Also on:    postgresql.org/message-id/ad76b9f205062009157b83571e@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: akhilss@gmail.com
  Subject: Re: prepareCall hangs
  In-Reply-To: <ad76b9f205062009157b83571e@mail.gmail.com>
  References: <ad76b9f205062009157b83571e@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox