Skip site navigation (1) Skip section navigation (2)

Re: thread hang on execute call

From: João Paulo Ribeiro <jp(at)mobicomp(dot)com>
To: Pavan Kumar <pavan(at)netcore(dot)co(dot)in>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: thread hang on execute call
Date: 2006-04-06 12:16:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I believe your problem is some kind of db lock.<br>
When the thread get stuck, execute this query to figure if the problem
is db locks:<br>
SELECT pg_class.relname AS table, pg_database.datname AS database,
transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database
WHERE pg_locks.relation = pg_class.oid AND pg_locks.database =
pg_database.oid order by pg_class.relname, pid;<br>
Best regards.<br>
Jo&atilde;o Paulo Ribeiro<br>
Pavan Kumar wrote:
<blockquote cite="mid1144323083(dot)26830(dot)53(dot)camel(at)pavan(dot)psmw" type="cite">
  <pre wrap="">hi
 again i stuck to same problem. 
i restarted my program. After 36 hour all thread got stuck with
postgresql call. 
both java thread and  postgresql are stuck on recv call....i couldn't
understand whats problem.why did it happen.
threads perform database intensive operation. there more then 60000
record in table.
could you tell me if i need to do any performance tuning things. like
increasing cache size.
each postgresql process taking 21-23 MB of memory.

here is the stack trace of postgresql process.

0  0x003437a2 in _dl_sysinfo_int80 () from /lib/
#1  0x00424451 in recv () from /lib/tls/
#2  0x08145aae in secure_read ()
#3  0x0814c062 in pq_recvbuf ()
#4  0x0814c121 in pq_getbyte ()
#5  0x081ad5fc in PostgresMain ()
#6  0x0818765d in ServerLoop ()
#7  0x0818904f in PostmasterMain ()
#8  0x0814dd18 in main ()

following is the stack trace of one of java thread. 

Thread 618: (state = IN_NATIVE)
byte[], int, int, int) @bci=0 (Co
mpiled frame; information may be imprecise)
 -[], int, int) @bci=84, line=129
(Compiled frame)
 - @bci=175, line=218 (Compiled
 - @bci=12, line=235 (Compiled frame)
 - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254 (Compiled
org.postgresql.core.v3.QueryExecutorImpl.execute(org.postgresql.core.Query, org.postgresql.core.
ParameterList, org.postgresql.core.ResultHandler, int, int, int)
@bci=129, line=188 (Interpreted fr
re.ParameterList, int) @bci=199, line=430 (Interpreted frame)
 - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
@bci=14, line=346 (Compiled fr
 - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
line=339 (Interpreted frame)
 - org.apache.commons.dbcp.DelegatingPreparedStatement.execute() @bci=8,
line=168 (Interpreted fram

On Tue, 2006-04-04 at 09:40 -0400, Tom Lane wrote:
  <blockquote type="cite">
    <pre wrap="">Dave Cramer <a class="moz-txt-link-rfc2396E" href="mailto:pg(at)fastcrypt(dot)com">&lt;pg(at)fastcrypt(dot)com&gt;</a> writes:
    <blockquote type="cite">
      <pre wrap="">Is it possible the query does not return ? Try adding a large  
statement timeout to the server.
    <pre wrap="">The stack traces say that the client and server are each waiting for
input from the other ... so somebody's confused about something.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               <a class="moz-txt-link-freetext" href=""></a>
  <pre wrap=""><!---->

Netcore Solutions Pvt. Ltd.
Website:  <a class="moz-txt-link-freetext" href=""></a>
Spamtraps: <a class="moz-txt-link-freetext" href=""></a>

Support FAQ : <a class="moz-txt-link-freetext" href=""></a>

This e-mail contains confidential and/or privileged information. If
  you are not the intended recipient (or have received this e-mail in
  error)  please notify the sender immediately and delete this e-mail. Any
  unauthorized copying, disclosure, use or distribution of the material in
  this e-mail is strictly forbidden.


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               <a class="moz-txt-link-freetext" href=""></a>

<pre class="moz-signature" cols="72">-- 
Jo&atilde;o Paulo Ribeiro | Senior Software Engineer
<a class="moz-txt-link-abbreviated" href="mailto:jp(at)mobicomp(dot)com">jp(at)mobicomp(dot)com</a>

PHONE: + 351 253 305 250
FAX  : + 351 253 305 250
<a class="moz-txt-link-abbreviated" href=""></a>


About Solutions | Wireless World

CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.</pre>

Attachment: unknown_filename
Description: text/html (5.7 KB)

In response to


pgsql-jdbc by date

Next:From: Oliver JowettDate: 2006-04-06 16:03:30
Subject: Re: thread hang on execute call
Previous:From: Dave CramerDate: 2006-04-06 12:07:14
Subject: Re: thread hang on execute call

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group