Problems caused by Silverlight RIA Services cache, silverlightria

Source: Internet
Author: User

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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.