CSLA.DATAPORTALEXCEPTION System.OutOfMemoryException

CSLA.DATAPORTALEXCEPTION System.OutOfMemoryException

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


LDSK posted on Tuesday, October 13, 2009

Hi there,

I get a csla.dataportalal exception On save of one of my Businessobjects.

I read the posts for the same exception. It was useful.

1.I checked that my classes dont have a circular reference.

2.I am wondering if this is because of the volumne of data. I do not have any bulky data, long strings or images or files. What i observed was i am able to do this operation when i list object has about 300 objects in it. When i exceute the same operation with about 7000 rows of data, it fails wiht a system.outOfMemoryException.

I do not have an option to rewrite my code.

Is there a limit on what the number of objects CSLA can handle? I do not have any complex objects, so it must be the sheer volumne.

 

Does any one else have any other information on the same?

Thanks in advance for all the replies

 

 

 

RockfordLhotka replied on Tuesday, October 13, 2009

The data portal needs to use the BinaryFormatter or NDCS to serialize the object graph. The serializers do have limits on the size of the object graph they can serialize. Can you look at the stack trace and try to get an idea what component was active when the exception occurred?

LDSK replied on Wednesday, October 14, 2009

thanks for the reply.

This is a snippet of the stack trace. This is the only part that was of any interest. The rest of the stack trace is full of references to my business objects. I also dont see anything related to a serializer in the exception. 

Csla.Server.CallMethodException: DataPortal_Fetch method call failed ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

   at System.Data.SqlClient.TdsParser.ReadTwoBinaryFields(SqlEnvChange env, TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.ProcessEnvChange(Int32 tokenLength, TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader()

 

RockfordLhotka replied on Wednesday, October 14, 2009

You are right, this is the part that is of interest. The exception is coming from SqlClient – so the issue has something to do with your database access or the data or something.

 

In short, the issue has nothing to do with the data portal, CSLA .NET, serialization or any of the things discussed thus far. The issue has to do with your SQL Server data access.

 

LDSK replied on Wednesday, October 14, 2009

Thanks again.

It just became harder to debug.

Any general pointers on how to debug further will help.

If SQl timed-out it will return a time out.

This happens on a new server we put in recently (SQL 2008) and a old Server, exiting (SQL 2000).

 

 

Copyright (c) Marimer LLC