[FIXED] ORMQueryExecutionException to be marked Serializable?

Posts   
 
    
ctadlock avatar
ctadlock
User
Posts: 60
Joined: 12-Feb-2004
# Posted on: 17-Mar-2004 07:17:19   

I get the following exception when an application exception is thrown in my remoting server. Is there a reason this class isn't marked serializable?

System.Runtime.Serialization.SerializationException: The type SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException in Assembly SD.LLBLGen.Pro.ORMSupportClasses.NET11, Version=1.0.2003.3, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27 is not marked as serializable.

Thanks CT

ctadlock

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Mar-2004 09:10:04   

Will do that in a new hotfix release of the runtime libraries today. (all exceptions will be made serializable).

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 17-Mar-2004 16:13:59   

I've uploaded a new hotfix for the runtime libraries which contains all exceptions as serializable.

Please note that the ORMQueryExecutionException does contain a Parameters collection, however this collection is not serialized, because the parameter objects aren't serializable.

Frans Bouma | Lead developer LLBLGen Pro
ctadlock avatar
ctadlock
User
Posts: 60
Joined: 12-Feb-2004
# Posted on: 17-Mar-2004 23:59:17   

Now I get this exception. I think we need a constructor that takes a SerializationInfo and a StreamingContext.

[SerializationException: The constructor to deserialize an object of type SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was not found.] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +264 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +877 CMI.v2.Data.Interface.IAdminService.CreateAdmin(Guid[] organizationIDs, Person person, Login login) +0 CMI.v2.Data.Access.BaseAdminConsumer.CreateAdmin(Guid[] organizationIDs, Person person, Login login) in C:\vss_carbon\CMI\Applications\v2\Data\Access\BaseAdminConsumer.cs:59 CMI.v2.ClientWebsite.test.TestAdmin.btCreateAdmin_Click(Object sender, EventArgs e) in C:\vss_carbon\CMI\Applications\v2\ClientWebsite\test\TestAdmin.aspx.cs:81 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain()

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Mar-2004 10:46:01   

Hmm, the class doesn't have a default constructor. I think that's it. You don't need a constructor which accepts a streaming info object because that's only required if you implement ISerializable :)

I'll try to dump some errors on purpose to see if it works here.

(edit) Ok, another weird mistake in the .NET design. If a base class implements ISerializable, you have to override the constructor in your own class and pass the received parameters. Makes the [Serializable] attribute pretty limited and inconsistent: (sometimes you also have to implement an constructor, sometimes you don't etc..). If you're lucky, the constructor is private in the base class... disappointed (not here fortunately) A little weird, but ok, nevertheless fixable simple_smile

So in other words: you were right, the default constructor wasn't required.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Mar-2004 21:00:38   

A fix for this is now available.

Frans Bouma | Lead developer LLBLGen Pro