This is a migrated thread and some comments may be shown as answers.

New quota must be larger than the old quota exception

8 Answers 113 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 15 Aug 2011, 05:35 PM
I'm using the Persistence framework to save and load RadDocking and a TreeView to Isolated Storage. I'm using a custom property provider for RadDocking and is working fine.
After a few saves, I'l get an error "New quota must be larger than the old quota exception" (see attached image). Once this happens I cannot save to Isolated Storage again.  I'm wondering if this is a problem on Telerik's side or am I supposed to catch this error and do something.

8 Answers, 1 is accepted

Sort by
0
Vivek
Top achievements
Rank 1
answered on 15 Aug 2011, 05:50 PM
Hi Scott,

This is a telerik issue. even I am getting same error.

Thanks,
Vivek.
0
Scott
Top achievements
Rank 1
answered on 15 Aug 2011, 05:52 PM
I tried increasing my Isolated Storage from 1.0MB to 6.0MB and the error went away.

I'm still curious how Telerik recommends handling this exception. It might be that we are supposed to trap the error and then ask the user to increase the storage size then attempt to save the persistence again.
0
Accepted
Alex Fidanov
Telerik team
answered on 16 Aug 2011, 06:44 AM
Hi Scott,

Thank you for reporting this issue. This has already been resolved with the latest internal build (from 15. Aug) and you should not see this exception anymore. The persistence framework would try to increase the quota if needed, but as this action must be user initiated, sometimes it would not succeed. When this happens, you can handle the QuotaRequested event of the IsolatedStorageProvider and check the IsSuccess property to see if the increase was successful. In the event args, you also have the size of the requested bytes and the file streams of the saved data.

Furthermore, we have exposed a method for quickly increasing the quota on the IsolatedStorageProvider itself.

Please let me know when you re-test this with the internal build and if you still see this exception occuring.

All the best,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Scott
Top achievements
Rank 1
answered on 16 Aug 2011, 05:04 PM
Thanks for the information. I probably will not test this for a while because I was using Isolated Storage for learning the persistence framework. I'll be streaming the XML to a database for my project.
0
sam
Top achievements
Rank 1
answered on 30 Jan 2018, 07:24 PM

Hello Alex,

We have the following version of Telerik controls:

Assembly Telerik.Windows.PersistenceFramework, Version=2016.2.503.45

 

However I am still seeing the New Quota must be larger than the old quota exception in my WPF application.  All i'm doing is calling the following method, which throws the exception and the user cannot navigate anymore:

public void Save()
        {
            new IsolatedStorageProvider().SaveToStorage();
        }

 

Please advise.

0
Martin Ivanov
Telerik team
answered on 31 Jan 2018, 10:11 AM
Hello Sam,

To avoid this you can manually increase the quota by calling the IncreaseQuita() method of the IsolatedStorageProvider.
IsolatedStorageProvider provider = new IsolatedStorageProvider();
provider.IncreaseQuota(5000000);
provider.SaveToStorage();

Regards,
Martin Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Markus
Top achievements
Rank 1
answered on 21 Sep 2018, 01:29 PM

Hello,

i'm using Telerik.Windows.PersistenceFramework 2016.1.314.45, Windows 10 and .Net 4.5.
I used the above mentioned approach "call IncreaseQuota()" to increase the quota. I tried even to 50,000,000 bytes for testing.
I still receive an ArgumentException when calling SaveToStorage().

Who is managing the isolated storage?
How can i find out the current quota?
What is the recommended way of handling those quota issues? I tried to register an QuotaRequested event handler but it is not called even if the quota is increased or insufficient.
What would be the disadvantage in using e.g. a file stream to store the UI states?

Thanks in advance.

0
Dilyan Traykov
Telerik team
answered on 26 Sep 2018, 11:23 AM
Hello Markus,

More information about IsolatedStorage and how it is handled can be found in this MSDN article.

As for finding the current quota, you will need to create a custom IsolatedStorageProvider so that you can access the protected GetIsolatedStoreOverride() method which in turn returns the underlying IsolatedStorageFile. This file in turn holds information for the Quota and AvailableFreeSpace.

public class CustomIsolatedStorageProvider : IsolatedStorageProvider
{
    public long AvailableFreeSpace
    {
        get { return this.GetIsolatedStoreOverride().AvailableFreeSpace; }
    }
 
    public long Quota
    {
        get { return this.GetIsolatedStoreOverride().Quota; }
    }
}

Regarding the QuotaRequested event, please note that it is not raised when manually increasing the quota via the IncreaseQuota method. It should, however, be raised if the available space is less than what is requested.

Would it be possible for you to open a new support ticket and send over a small sample project which demonstrates the exception as well as when you're attaching to the QuotaRequested event?

To address your last inquiry - I cannot think of any disadvantages of saving the layout to a stream instead. If you have any specific concerns, please let me know and I will try to further clarify.

Please let me know whether providing a sample project with the exception will be possible for you. I look forward to your reply.

Regards,
Dilyan Traykov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PersistenceFramework
Asked by
Scott
Top achievements
Rank 1
Answers by
Vivek
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Alex Fidanov
Telerik team
sam
Top achievements
Rank 1
Martin Ivanov
Telerik team
Markus
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or