Can an object be too large for the DataPortal to handle?

Can an object be too large for the DataPortal to handle?

Old forum URL: forums.lhotka.net/forums/t/5647.aspx


DocJames posted on Wednesday, October 22, 2008

I have a business object containing several other business object which are saved together as part of the same transaction.

When the objects contains several thousand rows of data I get the dreaded "The input stream is not a valid binary format" error message from the DataPortal.

I have tried to remove all code in the "DataPortal_Insert" method and I still get the error.

If the object only contains little data everything works fine.

The questions are:
   Can an object be too large for the DataPortal to handle?
   Is there any way to see the exact error message from the DataPortal.

Thanks,
Jimmy

sergeyb replied on Wednesday, October 22, 2008

What type of portal are you using?

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: DocJames [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 22, 2008 9:23 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Can an object be too large for the DataPortal to handle?

 

I have a business object containing several other business object which are saved together as part of the same transaction.

When the objects contains several thousand rows of data I get the dreaded "The input stream is not a valid binary format" error message from the DataPortal.

I have tried to remove all code in the "DataPortal_Insert" method and I still get the error.

If the object only contains little data everything works fine.

The questions are:
   Can an object be too large for the DataPortal to handle?
   Is there any way to see the exact error message from the DataPortal.

Thanks,
Jimmy



DocJames replied on Wednesday, October 22, 2008

I'm using the remoting portal

<add key="CslaDataPortalProxy" value="Csla.DataPortalClient.RemotingProxy, Csla" />

Should I change that to WCF instead or is there some workaround?

Thanks,
Jimmy

sergeyb replied on Wednesday, October 22, 2008

OK.  I see.  Where are you hosting the remoting service? IIS?  And yes, WCF is a good option.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: DocJames [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 22, 2008 10:26 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Can an object be too large for the DataPortal to handle?

 

I'm using the remoting portal

<add key="CslaDataPortalProxy" value="Csla.DataPortalClient.RemotingProxy, Csla" />

Should I change that to WCF instead or is there some workaround?

Thanks,
Jimmy



DocJames replied on Wednesday, October 22, 2008

sergeyb:

OK.  I see.  Where are you hosting the remoting service? IIS?  And yes, WCF is a good option.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

Yes, I'm using IIS to host the remoting service.

Is there some workaround? The application is live ...

Jimmy

sergeyb replied on Wednesday, October 22, 2008

This is just a guess – could you be running into IIS limit.  Try to add this to your web.config (size is in KB)

<system.web>

            <httpRuntime maxRequestLength="102400"/>

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: DocJames [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 22, 2008 10:37 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: Can an object be too large for the DataPortal to handle?

 

sergeyb:

OK.  I see.  Where are you hosting the remoting service? IIS?  And yes, WCF is a good option.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

Error! Filename not specified.
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

Yes, I'm using IIS to host the remoting service.

Is there some workaround? The application is live ...

Jimmy



DocJames replied on Wednesday, October 22, 2008

sergeyb:

This is just a guess – could you be running into IIS limit.  Try to add this to your web.config (size is in KB)

<system.web>

            <httpRuntime maxRequestLength="102400"/>

Wheeeee - that worked, thanks a lot Big Smile [:D]

I just looked at the WCF implementation in the Csla 3.0 PDF. It looks just as easy as using Remoting - so I will change my application to use WCF in near future.

Thanks,

Jimmy

 

RockfordLhotka replied on Wednesday, October 22, 2008

If you do switch to WCF, remember that both IIS and WCF have size limits - you'll need to up both.

tdrake replied on Thursday, October 23, 2008

.. if it's behind the firewall, you can use netTCP with WCF which is a hell of a lot faster then IIS as you use a binary rather then xml object stream.

I found this issue (size and performance) and switched the WCF with netTcp and the performance difference was amazing.

Tony 

DocJames replied on Thursday, October 23, 2008

RockfordLhotka:
If you do switch to WCF, remember that both IIS and WCF have size limits - you'll need to up both.

Thanks for the info. I will try and look it up :)

I saw you will be attending TechEd emea in Barcelona. I hope you are doing more than one session on CSLA...

 

tdrake:
.. if it's behind the firewall, you can use netTCP with WCF which is a hell of a lot faster then IIS as you use a binary rather then xml object stream.

I found this issue (size and performance) and switched the WCF with netTcp and the performance difference was amazing.

Tony 

Thanks for the tip. Unfortunately it's a ClickOnce application on the Internet. I will look at netTCP if I get to do an internal application.

Thanks,

Jimmy

Utopius replied on Friday, October 31, 2008

Rockford,

We have been using your CSLA framework for several years now.  However, we are now pulling datasets large enough to exceed the framework limitations.  We have modified the configuration files to overcome most of these issues, but we are strongly considering moving from a WCF BUFFERED apporach to a WCF STREAM approach.

Q1:  Is WCF streaming compatible with CSLA?

Q2:  Has this ever been attempted?  If so, were there any issues?

NOTE:   We are considering moving ALL of our remoting calls into a streaming mode in order to eliminate issues surrounding message size limitations.

 

______________

Jeff (Utopius)

 

...

Windows Communication Foundation (WCF) transports support two modes of transferring messages in each direction:

Setting the transfer mode to Streamed enables streaming communication in both directions.

(more info at http://msdn.microsoft.com/en-us/library/system.servicemodel.transfermode.aspx )

 

ajj3085 replied on Friday, October 31, 2008

Csla doesn't have any limits. The underlying remoting technology might though. 

Csla does support WCF, as of version 3.0.  You might want to buy the eBook to read up on it.

Copyright (c) Marimer LLC