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.
This issue was reported manually by gidravlic. It already has 3 duplicates Build: NetBeans IDE 7.4 (Build 201310111528) VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18 OS: Windows 7 User Comments: GUEST: While create entity classes from DataBase ... GUEST: I'm trying to make a new Database Entity Class. In my database (MS SQL 2005) we have a couple of views that contain no keys and additionally contain a union. This error occurs whenever NB (7.0 beta) attempts to enumerate tables / keys. Stacktrace: java.lang.StackOverflowError at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715) at java.util.regex.Pattern$Curly.match0(Pattern.java:4148) at java.util.regex.Pattern$Curly.match(Pattern.java:4132) at java.util.regex.Pattern$BranchConn.match(Pattern.java:4466) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615) at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
Created attachment 142892 [details] stacktrace
Could you please provide your db schema? I suspect, that the handling of the call to sp_depends is the cause of this problem, but with a trivial test database (AdventureWorks) this is not reproducible. If you can't provide the schema, could you check for unnatural names (tables/view with non-ascii names)?
Hi! Sorry, but i can't provide db schema. I noticed that if the number of tables and views is a small count, it does not fall wizard. Tables and views names contain only latin character.
To test my hypothesis, I tried create entity classes from my big database with 1394 tables. And wow!!! All work fine. How i can found invalid object in my db? Any guesses? Thanks!
I did some research and found that if you call sp_depends for one my view(View1) Procedure return: dbo.Table1 user table no yes ID dbo.Table2 user table no yes Table1ID dbo.Table2 user table no yes Date dbo.Table2 user table no yes String1 dbo.View2 view no yes String1 dbo.View2 view no yes String2 After this sp_depends procedure is invoked for view(View2): dbo.View1 view dbo.Proc1 stored procedure After again sp_depends for View1 and so until the error java.lang.StackOverflowError has occurred. FYI From MS SQL Help about db_depends: Important: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use sys.dm_sql_referencing_entities and sys.dm_sql_referenced_entities instead.
Created attachment 142979 [details] proposed patch v1
Thank you gidravlic for investigating! The simplest reproducer: create table t (id int); create view a as select * from t; create view b as select * from a; alter view a as select * from b; This way you create a recursive view definition. I see two possible solutions: 1. Track the dependency chain and skip dependencies if they are already analysed 2. Record the recursion level and break the chain at a certain depth. I decided to take the second route, as this also prevents excessivly deep chains. A patch implementing that is attached. With regard to the deprecation and replacement of the function, I would not consider it right now. The mentioned alternative "dm_sql_referenced_entities" is only presend in 2008 and newer. This is not that old (at work we have several 2005 instances running). As the problem can't be worked around (apart from cleaning the database), I'm raising the priority to P2.
matthias42 thanks for the quick response.
Finally patch applied: http://hg.netbeans.org/core-main/rev/244254c3c7f1 Matthias, thank you very much for it. Please verify if possible. Thanks
(In reply to Libor Fischmeistr from comment #9) > Finally patch applied: http://hg.netbeans.org/core-main/rev/244254c3c7f1 > > Matthias, thank you very much for it. > > Please verify if possible. I verified with the core-main build I did today and the db I created to reproduce the problem. While my 7.4 installation is broken (as in the original report), core-main works.