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.
Created attachment 132803 [details] This is where it stops Inside Netbeans 7.3: Steps: New File > Persistence > Entity Classes from Database > Data Source: jdbc/appName Retrieval of the Tables and Views begin, gets to 55% and then hangs. It freezes on the same view OR the very next view. I've tried on multiple machines - same result. Is there a limit on the size of the input data - in the wizard? Or, maybe a problem with the database - itself? thanks
Could you please attach IDE threaddump? (see http://wiki.netbeans.org/GenerateThreadDump for more info) Thanks.
except thread dump, please try to generate db schema as it may be schema generation issue during retrieve keys.
please reopen with details requested above. also, is it freeze? can you close the progress by cross or cancel? how big is your schema? can you share sql script to create the schema?
Created attachment 132850 [details] threaddump during hang while in entity classes from database wizard I performed the threaddump while running the IDE and the Entity classes from database wizard - oi ran it once the IDE hung. It hung at the same spot as pictured in the previous attachment
reopen for evaluation.
(In reply to comment #3) > please reopen with details requested above. > also, is it freeze? can you close the progress by cross or cancel? > how big is your schema? can you share sql script to create the schema? I cannot close by cross or cancel - only task manager
...this thing keeps saying "mid air collision..."
I will look more carefully tomorrow, but are you sure it's complete thread dump? I see no usual header and may be a bit smaller the usual.
mid-air collision detedted - keeps coming up....
reopened
Bugzilla won't let me add comments OR it won't show me the updated page...what am I doing wrong?
it was already reopened by me, also you can always click first on issue link on top to get fresh state. if you will have some time it's nice if you'll try to recreate thread dump, even 2 full dumps sometimes better then one. you one seems to be copied from comand line may as also contain some unusual newlines, can you forward output to some file?
Have you tried Persistence->generate DB Schema wizard also? With all tables selected for generation.
attached thread dump contain no .persistence.* classes, and no .db.* classes. please re-dump.
also I'm not sure it's P1 if it's reproducible for some specific schema only. but move to incomplete once again before gtting new thread dump and if schema generation works or not.
The attach thread dump is not complete. Please try to get the IDE into the state when it looks like it hangs and then trigger tread dump several times. And wait between each thread dump 5-10 seconds. That allows us to look at what's happening at the code level. Thanks. (In reply to comment #10) > mid-air collision detedted - keeps coming up.... This should happen only when two people are submitting issue changes at the same time. Happens very rarely. Try reload the page fully before responding and do not use Back button.
I think it is here: at org.netbeans.modules.dbschema.jdbcimpl.ViewDependency.getMSSQLServerPKTable(ViewDependency.java:149) but, how to fix, I dunno..... :-/
Created attachment 132923 [details] thread dump during hang
I'll add another...I'm creating the schema now...but, it seems to be hanging too....
ok, need to move to db area as persistence just use it here
"ok, need to move to db area as persistence just use it here" - what does this mean? Also, while generating the schema - netbeans hung, again... see attachment: threadForSchema also, I can add an atachment! bugzilla say "You already used the form to file attachment 132850 [details]."
I suppose it's occasional resolve-incomplete, feel free to reopen.
additional comments (from email)"All I need to do is: add entity classes from a database - using the wizard. This is for a web app for Union Bank. The connection to our server is successful, creating a "test page" with SQL fields is successful (as described in the affable bean tutorial), the glassfish server pings the pool successfully. Everything appears to be fine however, when I select the data source in the add entity classes from databases - wizard - it hangs on v_applicationStatusRootSumm (which is a Microsoft view that is built in SQL Server 2008 R2). I've run the thread dump (see attached) and I've run the SQL "generate schema" function on the IDE. Also, I've tried other Schemas and - they completed successfully - in the wizard. On top of that, we created a new schema, on a different server, and placed the tables, views, etc - that are needed, on that db/schema and the wizard will run but, it will hang, it will finish but - it will not populate the list on the left side of the wizard - Available tables." isn't populated tables may be another issue, not sure.
I am still experiencing the same issue. I have tried work-arounds but, to no avail. I need to delve into this farther and am considering opening a ticket with Microsoft - to have them check our DB however, I need to exhaust the Application side first
I haven't been able to reproduce the bug yet. I'll investigate it and let you know soon.
I still cannot reproduce. The table v_AdvertisementStatusRootSumm is not probably part of Microsoft SQL Server (I couldn't find it there), but seems to be part of Microsoft Systems Management Server. But I don't have access to this software. To fix the bug, I would need to have an example of view for which the "entity classes from database" fails. Could you please check structure of the view, try to guess what could be wrong with it, and create a simple view (and related tables) that causes the same problem? Thank you.
The stacktrace shows that the thread is runnable and the JDBC driver is reading some data. Maybe that the amount of data is huge and it takes a lot of time to process them. You could try to run the operation again, and create several stacktraces, with interval e.g. one minute, to check that the thread is still in the same method. The last SQL statement that was called is "{call sp_depends(?)}". The parameter is probably a view that v_AdvertisementStatusRootSumm depends on (directly or transitively). You can also run "call sp_depends('v_AdvertisementStatusRootSumm')" manually, check what dependencies of type "view" it returns, and then call "sp_depends('returned_view')" for all those dependencies, and continue recursively until some of the calls get frozen (then we would know which view causes the problem and also that the problem is not on NetBeans' side).
*** Bug 229425 has been marked as a duplicate of this bug. ***
When we try to add entity classes from the database. To our project, where does the Wizard pull the data from? I ask because, when we run the wizard, we are not getting any query records on the SQL side (Ie inside the SQL server manager).
(In reply to comment #30) > When we try to add entity classes from the database. To our project, where does > the Wizard pull the data from? I ask because, when we run the wizard, we are > not getting any query records on the SQL side (Ie inside the SQL server > manager). The wizard pulls data from the database, using the JDBC driver. The last query should be "call sp_depends(?)". You can see the relevant source code here: Method getMSSQLServerPKTable in http://hg.netbeans.org/core-main/file/530c37a18b46/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/ViewDependency.java
>> The stacktrace shows that the thread is runnable and the JDBC driver is >> reading some data. Maybe the amount of data is huge and it takes a lot of >> time to process them. Hard to reproduce, and not sure that the problem can be fixed in NetBeans. Decreasing priority. Further investigation is needed. A reproducible test case would be very helpful.
I also had the same problem mentioned. In my case I started the derby database and it worked.
According to the code, there is a potential infinite loop: the method getMSSQLServerPKTable() calls itself whenever a view have a dependency relationship with another view. If a view V1 depends on a column of another view V2, then MSSQLServer's stored procedure "sp_depends" reports the following: EXEC sp_depends v1 --> v2, view EXEC sp_depends v2 --> v1, view After the diagnostic, the bug corretion will be trivial: it is enough to avoid calling getMSSQLServerPKTable() twice for the same view.
(In reply to Edworld from comment #34) > According to the code, there is a potential infinite loop: the method > getMSSQLServerPKTable() calls itself whenever a view have a dependency > relationship with another view. > > If a view V1 depends on a column of another view V2, then MSSQLServer's > stored procedure "sp_depends" reports the following: > EXEC sp_depends v1 --> v2, view > EXEC sp_depends v2 --> v1, view > > After the diagnostic, the bug corretion will be trivial: it is enough to > avoid calling getMSSQLServerPKTable() twice for the same view. You are right - in current netbeans recursion is already limited (whether the limiit is to large is discussable). Please see bug 239181 for the corresponding bug.
I suppose if the reason is clear and there is supposed way to fix it, it may have sense to rise issue priority to at least p3, as p4 are rarely in view, and was set when there was much less information
Just vanted to to vote for this one, too...
same issue here
To the new commenters: It is good to know it is reproducible, but it is bad, that no further information is supplied. Please at least provide a thread dump (see: http://wiki.netbeans.org/GenerateThreadDump), as this should clearly show if the stack was overrun. Please also attach the message.log (http://wiki.netbeans.org/FaqLogMessagesFile). The fix i talked about in comment 35 was merged over a year ago is part of netbeans 8.
Created attachment 152584 [details] Thread dump when the wizard is stuck
I attached thread dump, I am running Netbeans 8.0.2 as well.
Created attachment 152586 [details] Testbuild of fix (In reply to broot02_86 from comment #41) > I attached thread dump, I am running Netbeans 8.0.2 as well. Thank you! That really helped. It looks like the recursion level is indeed too high - relevant is this entry in the stacktrace: org.netbeans.modules.dbschema.jdbcimpl.ViewDependency.getMSSQLServerPKTable(ViewDependency.java:169) or to be more precise the nearly 50 repetitions. Then the DB server does not answer anymore. I reviewed the fix from bug 239181 again (at that time it looked like the easier solution). Obvisually I was not totally correct. I now made a different approach (was thought about in the past and was suggested by edword). Basicly: Track which view was already analysed for this round and if so, log the cyclic dependency and go on. I attached a rebuild of the dbschema module. I would be great if you could test it. Beware: Make sure you have a backup copy of the files you modify! 1. grab the attached testbuild file 2. Backup <netbeans-directory>/java/modules/org-netbeans-modules-dbschema.jar 3. Overwrite the file from point 2 with the new version downloaded in point 1 4. Delete the cache directory of netbeans (http://wiki.netbeans.org/FaqWhatIsUserdir) 5. Do your test again The expected result: The process works and you will find an entry like this in the IDE Log (View -> IDE Log): WARNING [org.netbeans.modules.dbschema.jdbcimpl.ViewDependency]: Cyclic dependency detected in view definition: XY The output is buffered, so it can take a few seconds before that message is visible. I verified, that the new approach still fixes the problem in bug 239181.
Created attachment 152587 [details] Image of tested fix WARNING [org.netbeans.modules.dbschema.jdbcimpl.ViewDependency]: Cyclic dependency detected in view definition: viewNWIReceivedCheckDate Also in IDE Log.
Tested the new jar, and the fix seems to have solved this issue, works like a charm now, let me know if you need more details.
Thank you very much! This really helped. I pushed the fix into core-main: http://hg.netbeans.org/core-main/rev/47aad7fecf75 which ensures, that it will be in the next netbeans release. In the next few days a netbeans nightly build is created - a message is then appended to this bug. Please test that build if the bug is really fixed. This is necessary because I did some more changes (warnings, clean-ups) and I want to be save that this does not break it again. I verified already, that bug 239181 is still fixed - if you also find the bug fixed in the nightly please change the status of this bug from FIXED to VERIFIED. Thanks again!
Integrated into 'main-silver', will be available in build *201503160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/47aad7fecf75 User: Matthias Blaesing <matthias42@netbeans.org> Log: #227678: Change cycle detection in view dependency analyser, don't limit recursion level, but record visited children
*** Bug 246034 has been marked as a duplicate of this bug. ***