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

GridException is not serializable

5 Answers 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 11 Feb 2009, 07:57 PM
I'm working with a RadGrid contol.  I messed up the DataField properties of its contained GridBoundColumns, and got an exception at runtime.  But, because I'm running with SessionState set to 'StateServer', instead of to 'InProc', the exception I saw was about a serialization error:

[SerializationException: Type 'Telerik.Web.UI.GridException' ... is not marked as serializable.]
 

I switched Session.mode to 'InProc', and quickly discovered the error:

There was a problem extracting DataKeyValues from the DataSource. ... 

But I shouldn't have had to do this.  If GridException is ever put into the Session, it should be marked as Serializable.

We set SessionMode to 'StateServer' as a matter of course, on our development machines, for the specific purpose of revealing serialization errors during development.

Any web application of significance must be capable of running in a clustered environment.  We need to ensure that our implementors have the option of using shared sessions when installing in a clustered environment.  So we need to make sure we don't write our code in a way to make that impossible.

Might I suggest that your developers might consider doing the same?  True, 'InProc' is what Microsoft's tools default to, but it's not a good default to develop against.



5 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 16 Feb 2009, 12:07 PM
Hello Jeff,

RadGrid does not save any of its object in Session and GridException as such not persisted in Session as well.

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeff
Top achievements
Rank 1
answered on 16 Feb 2009, 06:55 PM
System.Exception is serializable. Everything derived from it should be serializable.  Certainly, all of Microsoft's defined exceptions are serializable.

You may not be putting GridException in the Session.  But somebody's code is.  It could be ours - we commonly catch exceptions, then throw new exceptions, including the caught exception as an inner exception.  Or it could be yours.  Or it could be ASP.NET's.  I didn't pay much attention to figuring out the whos or whys.

I'm just pointing out that Exceptions are generally serializable, and that yours aren't.
0
Nikolay Rusev
Telerik team
answered on 19 Feb 2009, 08:55 AM
Hello Jeff,

I forwarded your request to our developers and all GridException's will be marked serializable.
Hopefully this will be available with Q1 2009 of RadControls for ASP.NET AJAX.

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
nick
Top achievements
Rank 1
answered on 13 Mar 2009, 08:45 PM
Was wondering if this got put into the Q1 release or not?  Have found that sorting on the grid seems to throw an error if session state is put into SQLServer, though it works when put into InProc mode.
0
Sebastian
Telerik team
answered on 16 Mar 2009, 11:14 AM
Hi nick,

The RadGrid exceptions should be marked as serializable in the latest release 2009.1.311 of the product (Q1 2009) which was announced last week.

Best regards,
Sebastian
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Jeff
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Jeff
Top achievements
Rank 1
nick
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or