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 191982 - netbeans gets confused after running multiple SQL queries
Summary: netbeans gets confused after running multiple SQL queries
Status: RESOLVED INCOMPLETE
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: PC Other
: P1 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 20:55 UTC by athompson
Modified: 2010-12-14 13:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
the table DOES exist! (91.66 KB, image/png)
2010-11-15 22:32 UTC, athompson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2010-11-15 20:55:47 UTC
This happens with a number of databases I have to connect to, all running SQL server 2005.  I don't know if it happens with other databases.  The problem has been present in the daily builds (and releases) for months, at least.

After running a number of queries in the SQL editor, Netbeans will eventually get confused.

For starters, queries which ran fine before will start to fail with messages like "unknown object 'tblRKUsers'", when that table is clearly there an the query runs fine everywhere else.  If you keep trying to run the query over again it will start to work again, but only intermittently.

Once things get to the stage where the query is working intermittently, complex queries will start producing the wrong results!  So about 1/2 of the time the query will yield that 'unknown object' error, and most of the remaining time the results will be wrong, and only every now and then will the results be right.  The only thing I can think of is that Netbeans doing something behind the scenes to produce results only one page at a time, and that code is getting confused somehow.  This is only a wild guess however.

At this point, trying to quit the IDE takes a very long time (in the order of minutes).  Once the IDE does quit, the 'netbeans.exe' process is still running and you need to explicitly kill it using Windows Task Manager.

If you try to disconnect from the database from the 'Services' tab when Netbeans is in this state, Netbeans will lock up and you need to explicitly kill it using Windows Task Manager.


Product Version: NetBeans IDE Dev (Build 201011150001)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Users\athompson\.netbeans\dev

SQL server 2005, latest driver (Microsoft SQL Server JDBC Driver 3.0)
Comment 1 athompson 2010-11-15 22:32:12 UTC
Created attachment 102990 [details]
the table DOES exist!
Comment 2 athompson 2010-11-16 17:23:04 UTC
I guess this has to be a P1 since the lockup can lead to data loss.
Comment 3 Jiri Rechtacek 2010-11-16 18:00:37 UTC
I got confused with your description. I see your laments but I cannot take some reproducible part and make myself clear what's wrong. According your description I don't see what I should fix. I'm sorry. Moreover, I don't see justification why it's P1 issue? Any regression? Where is a data loss? Let's spare P1 for very urgent issues, not like this.
Comment 4 athompson 2010-11-17 14:14:46 UTC
As I mentioned in the description, the data loss occurs when trying to disconnect from the DB or trying to exit.  When trying to disconnect (which is a reasonable reaction if things aren't working properly), the IDE will lock up completely.  When trying to exit, the window will close but the "netbeans.exe" process keeps running.  Surely you agree that these are problems that sure be addressed.

I'm not sure why you're confused, but I'll list the incorrect behavior here, all of which seems to be rooted in the same cause:

1. The IDE will lock up if you try to disconnect from the DB.
2. The "netbeans.exe" process is still running when you exit the IDE.
3. Queries will return with SQL errors saying that it couldn't find tables that exist.
4. Queries produce incorrect/incomplete results.  When this happens, the returned result set size is often the paging size + 1, which leads me to guess that it may have something to do with the code that breaks up the results into pages.

I'm also not sure why you can't reproduce this.  I routinely can with clean installs and a different computer.   Are you trying with a Windows box?  Do you want me to attach the driver here?
Comment 5 bht 2010-11-28 08:22:50 UTC
Hi, I just stumbled over this bug but I have not experienced it myself.
Reporter, if I wanted to reproduce your problem I wouldn't know where to start.

You could help by trying to narrow down your scenario to a testcase that is reproducible easily. I know this could be hard work.

There are multiple possible paths to follow, and no guarantee which one is right.

I would suggest you try to eliminate factors, eg the database driver. Try to reproduce the problem with a database that is installed with NetBEans: JavaDB.

If no luck then try to script everything with SQL server 2005. Try to reduce the number of tables and queries and so on, until the error disappears. Pin it down.

Good luck!
Comment 6 Antonin Nebuzelsky 2010-12-14 13:36:06 UTC
Please, help us understand what triggers the problem. As mentioned above, as smallest reproducible testcase as possible (including a driver that we can test with, and including an SQL command we can run) can only help to evaluate the problem.

> When trying to disconnect the IDE will lock up completely.

Please, attach a thread dump of the locked IDE to this issue.

http://wiki.netbeans.org/GenerateThreadDump