Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hello all,

Im developing a mobile device app,and im using syncframework to sync .sdf database on device with sql server 2008 in server. Im using WCF service library as a middle tier. I have a large number of rows and tables to sync,and i get an out of memory exception. I updatet the code using datasetsurrogate but i get the exception again.Is there any solution for this? I also tried with resultset instead of dataset,but nothing changed.

Thanks in advance.

here is the article i used to do the datasurrogate,and it depends on a ms wlakthrough http://jtabadero.wordpress.com/2010/03/08/sync-framework-wcf-based-synchronization-for-offline-scenario-%E2%80%93-using-custom-dataset-serialization/[^]

here is where i get the out of memory exception:

C#
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ICompactDataCacheSyncContract/GetChanges", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
       public SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession, [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] out byte[] dataSetSurrogateByteArray)
       {

           object[] results = this.Invoke("GetChanges", new object[] {
                       groupMetadata,
                       syncSession});
           dataSetSurrogateByteArray = ((byte[])(results[1]));
           return ((SyncContext)(results[0]));
       }
Posted
Updated 12-Jul-12 21:34pm
v3
Comments
[no name] 12-Jul-12 10:08am    
Perhaps a bit of code that demonstrates your problem might help.
darshan_ur 13-Jul-12 5:51am    
I am not an expert, but i think our mobile team also faced similar problem. the main problem was that the Database on Mobile device is by default allowed to store only few MB's of Data or less. If the error is on Device then this might be a reason.

But here it seems you are trying to load almost full database which will consume a lot of memory. Try loading only filtered data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900