Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Clone/Serialization takes long time

$
0
0

Normal 0 false false false MicrosoftInternetExplorer4

I have a BLB EmployeeList which contains a child BLB HrDocumentList.  The HrDocumentList uses a separate DAL and connection than the EmployeeList.  The EmployeeList is roughly 110 Employee objects, and each Employee object has roughly 100 HrDocument objects.

 When I save changes the ViewModel class clones the EmployeeList prior to saving.  But the clone takes 8 seconds.  I made the HrDocumentList a private backing field and NonSerialized.  This resolved the performance issue, but introduced another issue elsewhere.

 I don’t fully understand the serialization process and how it all works together.  Does the separate DAL have anything to do with it?  How do I troublehsoot this issue?

    Public Shared ReadOnly HRDocumentsProperty As PropertyInfo(Of HRDocumentList) = RegisterProperty(Of HRDocumentList)(Function(c) c.HRDocuments, RelationshipTypes.Child)    Public ReadOnly Property HRDocuments As HRDocumentList        Get            If Not (FieldManager.FieldExists(HRDocumentsProperty)) Then                Dim criteria As New Criteria.HRDocumentCriteria                criteria.And.EmployeeId.Equal(PayrollID)                LoadProperty(HRDocumentsProperty, DataPortal.Fetch(Of HRDocumentList)(criteria))            End If            Return GetProperty(HRDocumentsProperty)        End Get    End Property    'Public Shared ReadOnly HRDocumentsProperty As PropertyInfo(Of HRDocumentList) = RegisterProperty(Of HRDocumentList)(Function(c) c.HRDocuments, RelationshipTypes.PrivateField)    '<NonSerialized>    'Private _hrDocuments As HRDocumentList    'Public ReadOnly Property HRDocuments As HRDocumentList    '    Get    '        If Not (FieldManager.FieldExists(HRDocumentsProperty)) Then    '            Dim criteria As New Criteria.HRDocumentCriteria    '            criteria.And.EmployeeId.Equal(PayrollID)    '            _hrDocuments = DataPortal.Fetch(Of HRDocumentList)(criteria)    '        End If    '        Return GetProperty(HRDocumentsProperty, _hrDocuments)    '    End Get    'End Property

 


Viewing all articles
Browse latest Browse all 764

Trending Articles