This is a migrated thread and some comments may be shown as answers.

[Solved] Batch update, deep models and "Out of stack space" error

3 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
IT
Top achievements
Rank 1
IT asked on 31 Aug 2011, 12:43 AM

Are there any known limitations to the depth of the object tree bound to a grid?

 

I’m getting a javascript “Out of stack space” error when trying to save changes to an edited grid in batch mode. It’s not getting as far as the AJAX call.

 

For example, if I bind to a list of Books:-

 

Book (BookModel)

  Author (AuthorModel)

    Publisher (PublisherModel)

 

 

BookModel has a property Author (of type AuthorModel), and AuthorModel has a property Publisher (of type PublisherModel). PublisherModel just has a few properties of basic types, so nothing recursive.

 

The above works fine for binding/displaying data… I bind the grid using AJAX and can include properties from all levels in the grid.

 

However if I try to edit a cell and click save, I get the “Out of stack space” error.

 

Through trial and error I discovered that if I remove the Publisher property from the AuthorModel, it will work as expected.

 

This occurs irrespective of whether I am using any of the properties of the Publisher in the grid… simply having the model referenced within Author is enough to cause the issue.

 

I’ve even tried creating another (unrelated to PublisherModel) model and attaching it to AuthorModel, with the same results… it seems to be the third level of model causing the issue.

 

I’ve tried ripping everything out of the page and reducing the grid to the most basic required to function, with a single column that references a string property at the top level (BookModel), but the error still occurs when I try to save changes.

 

The error is occurring in telerik.grid.editing.min.js at byte/column 7173… “a(n,m,o?o+"."+p:p)”… in “function a(n,m,o)” which seems to be recursively building the object tree and getting in an infinite loop?

 

 

TIA for any help…

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 31 Aug 2011, 02:04 PM
Hello Aleks,

You are the first to report such problem and at this point we cannot tell what might be the reason for it.
Please send us a sample project so we can investigate further - this blog post, that shows the general logic in isolating an issue, will help you in this task.  Note that you don't have to send us your real database - you could use a fake one, like the ones linked in the blog post.
 

Greetings,
Georgi Tunev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
IT
Top achievements
Rank 1
answered on 02 Sep 2011, 12:49 AM
I have created a test project which demonstrates the issue.

Once started, navigate to the Grid\Index view...

You'll note that the object tree is three models deep (book, author, publisher as per my earlier post)

The grid is displaying data from all three levels successfully.

Click in a cell to edit, the click save, and you'll get the "out of stack space error".

Removing references to PublisherModel (as a property in AuthorModel, the grid definition and the dummy data in BookModel.GetAll) and the grid performs as expected.



On a side note, I generally post in the forums rather than raise a support case (despite being a paid up premium customer) as I get a faster response that way, and I think it's better for the community if they can see the causes and solutions to these problems.

I put a lot of effort into diagnosing and providing a lot of information in my initial post. It should have been pretty simple to reproduce this problem rather than sending a boilerplate response pushing it back to me. It's a pretty disturbing trend, both in the many issues I've come across with this product, and the responses I see to other people in the forums.

I know there are some people who will throw their hands up at the first sign of a problem and post "it doesn't work". I put a lot of effort into troubleshooting and researching these problems before I post, and I feel entitled to the same in return.

I expect the response to this will be to raise a support case instead (as I've seen in many other posts) which I'd gladly do if it gave me (and the telerik community) a better outcome...
0
Atanas Korchev
Telerik team
answered on 03 Sep 2011, 09:18 AM
Hi Aleks,

We indeed did some tests on our side before asking you for a project - please accept my apologies for missing that fact in my previous reply.

Thanks to your project we were able to reproduce the JavaScript error and confirm this was caused by an infinite recursion in our code. This bug is now fixed and I am sending attached the hotfix build. I also updated your Telerik points.

As for the second part of your post, the forums are a community resource and although we monitor them closely, we do not guarantee a timely reply here. That is why we recommend to our customers to use the support ticketing system when they need a faster reply. The ticketing system assigns a response time to every ticket, according to the purchased license. 
The other most common reason for us to ask for a support ticket is in the fact that the MVC forums are the only ones where a project can be attached. The other forums like the ASP.NET AJAX ones, are discussing products with developer versions that are available only after a purchase. We restrict the uploading of archives there simply because we want to protect our customers' property and prevent the upload of projects with developer versions of these controls.

Kind regards,
Atanas Korchev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
IT
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
IT
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or