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 262241 - AssertionError at org.netbeans.lib.profiler.results.jdbc.SQLConnection.prepareStatement
Summary: AssertionError at org.netbeans.lib.profiler.results.jdbc.SQLConnection.prepar...
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-26 15:34 UTC by chunkyks
Modified: 2016-06-16 15:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 224228


Attachments
stacktrace (1.33 KB, text/plain)
2016-05-26 15:34 UTC, chunkyks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chunkyks 2016-05-26 15:34:06 UTC
Build: NetBeans IDE Dev (Build 201605260002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.91-b14, Java(TM) SE Runtime Environment, 1.8.0_91-b14
OS: Linux

User Comments:
chunkyks: Was just running a database-intensive desktop application under the SQL Profiler.




Stacktrace: 
java.lang.AssertionError
   at org.netbeans.lib.profiler.results.jdbc.SQLConnection.prepareStatement(SQLConnection.java:75)
   at org.netbeans.lib.profiler.results.jdbc.SQLConnection.invoke(SQLConnection.java:61)
   at org.netbeans.lib.profiler.results.jdbc.JdbcGraphBuilder.methodEntry(JdbcGraphBuilder.java:281)
   at org.netbeans.lib.profiler.results.cpu.CPUDataFrameProcessor$1.execute(CPUDataFrameProcessor.java:523)
   at org.netbeans.lib.profiler.results.AbstractDataFrameProcessor.foreachListener(AbstractDataFrameProcessor.java:177)
   at org.netbeans.lib.profiler.results.cpu.CPUDataFrameProcessor.fireMethodEntry(CPUDataFrameProcessor.java:521)
Comment 1 chunkyks 2016-05-26 15:34:08 UTC
Created attachment 159893 [details]
stacktrace
Comment 2 Tomas Hurka 2016-05-27 07:04:35 UTC
Thanks for the report. Can you provide exact steps how to reproduce it? Thanks.
Comment 3 Tomas Hurka 2016-06-10 15:06:55 UTC
Is there any update about steps?
Comment 4 chunkyks 2016-06-10 15:15:00 UTC
I have a large app that interacts with the DB, a lot, incessantly. It seems like this happens every time I run the app, without any specific reproduction steps.

I'm using this jdbc driver: https://bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.8.11.jar

After running the App for a while [hundreds of thousands of SQL queries, maybe], netbeans begins to slow to a crawl. Eventually this exception just occurs

Unfortunately, I cannot share the source or even binaries for this application :-/
Comment 5 Tomas Hurka 2016-06-11 10:05:43 UTC
OK, are you able to reproduce it reliably? Can report the exception several times?
Comment 6 chunkyks 2016-06-11 17:47:22 UTC
I reported a bunch, they're all marked as duplicates here: http://statistics.netbeans.org/analytics/exception.do?id=821588

While recreating, I experimented with exactly where it happened that caused netbeans to throw that Assertion. Unfortunately, in the case I'm using right now: If I stop processing before these two lines, netbeans doesn't throw. If I stop immediately inside the braces, netbeans does throw:

    String sql = "SELECT playerid, playernum, playertype, lat_dd, lon_dd, is_altloc FROM player";
    try(PreparedStatement stmt = cs.getDbConn().prepareStatement(sql)) {


I also take back what I said before; I don't have to leave it running for a long time, this is only a few seconds in. I think that before, when I left it running for a long time, netbeans had probably thrown the assertion while my program continued running, and I only noticed the exception after exiting.

This also happens if I profile only "defined queries" and include a filter that the query must contain "SELECT". Specific exception reported in that case was this one:
http://statistics.netbeans.org/analytics/exception.do?id=821592


In case it's relevant, I get a lot of these messages when profiling begins [but I think I've been seeing, and ignoring, that for as long as I've been using netbeans [since major version 5]]:

Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Profiler Agent Warning: JVMTI classLoadHook: class name is null.
Comment 7 chunkyks 2016-06-11 17:51:45 UTC
Also unfortunately, if I try to create a minimal testcase that only includes the CREATE TABLE statement for player, and just prepare that SELECT, the Assertion doesn't happen
Comment 8 Tomas Hurka 2016-06-13 11:35:02 UTC
Thanks for the info and reports. I will try to fix this issue.
Comment 9 Tomas Hurka 2016-06-13 18:26:37 UTC
Hopefully fixed by:

changeset:   297395:d54cd546f0f3
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon Jun 13 17:04:23 2016 +0200
summary:     bugfix #262241, store SQLStatement (instead of SQLConnection) in currentObject
Comment 10 chunkyks 2016-06-15 15:47:56 UTC
Normally these bugzilla entries subsequently get an update when they make it into the nightly build - am I missing something or is it not available yet?
Comment 11 Tomas Hurka 2016-06-16 07:24:06 UTC
You are right, there should be comment with daily build number. I don't know why issue was not updated. The fix is in latest daily build 
NetBeans IDE Dev (Build 201606160002) (#b7d1096fa3ea)
Comment 12 Jiri Kovalsky 2016-06-16 08:45:37 UTC
There was an outage in daily builds [1] which probably hit this bug and caused that notification was not added here. We apologize for the inconvenience.

[1] http://nbbuilder.uk.oracle.com:8080/view/NB-Trunk/job/NB-trunk/1366/console
Comment 13 chunkyks 2016-06-16 15:37:54 UTC
Good news: the latest nightly is no longer crashing for me :-)

Thanks!