Re: Can't throw the dreaded 'idle in transaction' - need help!

From: Vadim Nasardinov <vadimn(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: temp02(at)bluereef(dot)com(dot)au
Subject: Re: Can't throw the dreaded 'idle in transaction' - need help!
Date: 2004-11-23 15:15:29
Message-ID: 200411231015.29259@vadim.nasardinov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tuesday 23 November 2004 01:03, Temp02 wrote:
> We don't use any Java locking with the application we leave it all
> up to the DB.

Not a single synchronized block of code in your entire application?

Did you try sending a SIGQUIT to your application, as Oliver suggested
in http://archives.postgresql.org/pgsql-jdbc/2004-11/msg00169.php

| $ cat Main.java
| public class Main {
| public static void main(String[] _) throws InterruptedException {
| while (true) {
| Thread.sleep(1000);
| }
| }
| }
|
| $ javac Main.java
| $ java -cp . Main &
| [1] 9346
| $ ps -ef | grep java
| vadim 9346 7513 3 10:03 pts/0 00:00:00 java -cp . Main

In response to a SIGQUIT, the JRE should dump stack traces for all the
current threads, like so:

| $ kill -QUIT 9346
| Full thread dump Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode):
|
| "Signal Dispatcher" daemon prio=1 tid=0x08095950 nid=0x2482 waiting on condition [0..0]
|
| "Finalizer" daemon prio=1 tid=0x08090e90 nid=0x2482 in Object.wait() [4c792000..4c79287c]
| at java.lang.Object.wait(Native Method)
| - waiting on <0x44590490> (a java.lang.ref.ReferenceQueue$Lock)
| at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
| - locked <0x44590490> (a java.lang.ref.ReferenceQueue$Lock)
| at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
| at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
|
| "Reference Handler" daemon prio=1 tid=0x080902e8 nid=0x2482 in Object.wait() [4c711000..4c71187c]
| at java.lang.Object.wait(Native Method)
| - waiting on <0x44590380> (a java.lang.ref.Reference$Lock)
| at java.lang.Object.wait(Object.java:429)
| at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
| - locked <0x44590380> (a java.lang.ref.Reference$Lock)
|
| "main" prio=1 tid=0x0805ab88 nid=0x2482 waiting on condition [bfffd000..bfffd55c]
| at java.lang.Thread.sleep(Native Method)
| at Main.main(Main.java:4)
|
| "VM Thread" prio=1 tid=0x0808f088 nid=0x2482 runnable
|
| "VM Periodic Task Thread" prio=1 tid=0x080981a0 nid=0x2482 waiting on condition
| "Suspend Checker Thread" prio=1 tid=0x08094f98 nid=0x2482 runnable

Except yours will be a lot longer.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2004-11-23 15:48:09 Re: When running with autocommit false only the first BEGIN
Previous Message Tom Lane 2004-11-23 15:09:51 Re: [JDBC] Strange server error with current 8.0beta driver