This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 110161 - Livelock in JavaSource when binding table
Summary: Livelock in JavaSource when binding table
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-18 15:11 UTC by Jiri Vagner
Modified: 2007-07-31 15:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (28.93 KB, text/plain)
2007-07-18 15:11 UTC, Jiri Vagner
Details
threads.txt (19.91 KB, text/plain)
2007-07-18 15:11 UTC, Jiri Vagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Vagner 2007-07-18 15:11:16 UTC
Steps to reproduce:
 - create new jda project
 - add jtable into main view
 - select jtable and invoke popup menu for jtable
 - run "Bind -> elements"
 - use Import Data from ... button
 - select some simple db table (for example Travel db, Flight table) and press ok

Product Version: NetBeans IDE Dev (Build 200707171936)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)
Comment 1 Jiri Vagner 2007-07-18 15:11:39 UTC
Created attachment 45324 [details]
messages.log
Comment 2 Jiri Vagner 2007-07-18 15:11:58 UTC
Created attachment 45325 [details]
threads.txt
Comment 3 Jan Stola 2007-07-20 16:21:20 UTC
There seems to be a "livelock" in JavaSource.

The problem begins with invocation of method AnnotationModelHelper.runJavaSourceTaskWhenScanFinished() that in turns 
invokes JavaSource.runWhenScanFinished(). The method returns Future and there is get() method of this Future invoked in 
AWT thread (I know that it is ugly, but that's another issue; it IMHO is not important for that issue). Unfortunately, 
the get() method will not return. It should be released by Java Source Worker Thread, but this thread is in an infinite 
loop. It attempts to obtain next request from JavaSource.requests (line JavaSoure.java:1393), but this queue is empty. 
It can be verified in debugger that the original task passed to JavaSource.runWhenScanFinished() still waits in 
JavaSource.todo.

It seems that there is some race condition in JavaSource that allows to finish the scan and leave the deffered task in 
todo list.

Reassigning to java/source for evaluation.
Comment 4 Jan Stola 2007-07-20 16:24:44 UTC
I was able to reproduce this problem using New File ... > Swing GUI Forms > Master/Detail Sample From as well.
Comment 5 Tomas Zezula 2007-07-24 13:17:07 UTC
Checking in org/netbeans/api/java/source/JavaSource.java;
/cvs/java/source/src/org/netbeans/api/java/source/JavaSource.java,v  <--  JavaSource.java
new revision: 1.73; previous revision: 1.72
done
Comment 6 Jiri Vagner 2007-07-31 15:17:36 UTC
Now there is no problem while importing data from ... , tested on linux and mac.
Also there is a brand new cool "Please wait ... Importing" dialog! :)
Verified

Product Version: NetBeans IDE Dev (Build 200707310341)
Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)