Problems caused by Silverlight RIA Services cache, silverlightria
Problem description:Use RIA Services of Silverlight to update the database. An exception is found during repeated submission. A SubmitOperation error occurs, prompting an object class conflict, check that the previously deleted data exists (the database has been deleted). When you delete the data that does not exist in the database, an error is returned.
Solution:Load the data again in each commit operation to ensure synchronization with the database data. The Load data is operated to clear the impact of cached data. The problem is solved.
Cause:This is because every time RIA Services retrieves data from the database and places it on the client based on the query conditions, and makes it an entity class to facilitate developers to add, delete, modify, and query data, and then submits all operations through the SubmitChange method, updating the database may cause database updates, but the data on the client has not been updated, causing an error.
In addition, you must determine the IsSubmitting and IsLoading statuses of Domain Services before submission to avoid submission failure.
How to add, delete, modify, and delete Silverlight wcf ria Services returned IEnumerable <T> type is not displayed
Is it set to bidirectional when binding page data?
Have you implemented the INotifyPropertyChanged interface and implemented the yypropertychanged method?
How to clear the Silverlight cache? 100,000 in a hurry
When the Silverlight cache volume is large, you need to consider the code to solve the performance problem,
We recommend that you use some coding precautions to avoid the full cache of Silverlight:
Set EnableFrameRateCounter to True during development
Exercise caution when using the Silverlight plug-in with a transparent background
Sets its CacheMode when animations are performed on the opacity or conversion of a UIElement.
Cache visible elements when layers of an object are mixed with opacity objects and rotated or stretched objects
Avoid window-free mode
Use Visibility instead of Opacity as much as possible
Silverlight uses multiple cores in rendering and media
Hide unused objects in full screen mode
Do not use Width and Height together with the MediaElement object
Do not use Width and Height with the Path object
Splits tasks that consume a large amount of CPU resources into smaller tasks.
Very large application package Decomposition
Use Double. ToString (CultureInfo. InvariantCulture) instead of Double. ToString ()
Use Stretch = "Fill" to present a large number of images"
This reduces performance and cache load during development.