Hi,
Iam getting OutOfMemoryException while making remote method call.
"RemoteEntity.SetLocalStore(DATASET);"
passed value is dataset.
Note Size of dataset is 38mb
Envoirment c# VS2008
Thanks
Code :
private void backgroundSync_DoWork(object sender, DoWorkEventArgs e)
{
backgroundSync.ReportProgress(10, "Fetching data for sync ...");
EngagementSet _remoteSet = HKMPClient.Instance.RemoteEntity.GetLocalStore();
//Update to release memory.
HKMPClient.Instance.RemoteEntity.SetLocalStore(null);
//dispose RemoteEntity
HKMPClient.Instance.DisconnectAndDispose();
HKMP.EngagementWorks.Windows.BLL.Engagements.Engagement.MergeEntitiesInLimitedConnecitivity(_remoteSet,EngagementID);
backgroundSync.ReportProgress(10, "Synchronizing Engagement ...");
DialogSync _dlgSync = new DialogSync(this.EngagementID, _remoteSet);
_dlgSync.ServiceRequestStarted += new DialogSync.OnServiceRequestStarted(_dlgSync_ServiceRequestStarted);
_dlgSync.ServiceRequestCompleted += new DialogSync.OnServiceRequestCompleted(_dlgSync_ServiceRequestCompleted);
if (_dlgSync.IsShown())
{
_dlgSync.StartPosition = FormStartPosition.CenterParent;
_dlgSync.WindowState = FormWindowState.Normal;
_dlgSync.ShowDialog();
}
//Disposed to release object.
_dlgSync.Dispose();
_dlgSync = null;
// connect again
HKMPClient.Instance.Connect(e.Argument.ToString());
_remoteSet.RemotingFormat = SerializationFormat.Binary;
HKMPClient.Instance.RemoteEntity.SetLocalStore(_remoteSet);
}