This project has moved and is read-only. For the latest updates, please go here.

Load after Restart

Mar 23, 2011 at 5:24 PM

I am using the latest build and encounter some strange problem.

I am creating a bunch of entries, Flushing them out directly after they were created.
Directly after creating the table (not exiting the app) I could do all kind of queries. No big deal.

A seperate Flush is done before .Dispose will be called.

Loading the DB again leads to nothing. Empty...

I have not found any running example in the current sources where you retrieve the data after the app is restarted. Maybe extend your demoapp a bit in the future?
The Unittests are no help because they run within the current instance.

Btw. I am using the release version with no problem (and versions before that). Upgrading to the newest drop is somehow difficult.
Any idea what the problem might be?


Mar 23, 2011 at 5:37 PM

The Sterling desktop example does what you asked. I have tested it several times. The first time you run it, it will restore the database and persist it to isolated storage. On subsequent runs, it just loads it as is. It works fine.

There are tests for restarting. The TestSaveAndLoad with the Tag "SaveAndLoad" does this in TestSaveShutdownReInitialize - you'll notice for the memory one it retains the same memory driver because that's the only way for the memory to be kept, but I've checked in changes to both the elevated trust and the isolated storage drivers that create an entirely new copy of the driver and completely shut down, reinitialize the engine - just pull the latest changset (the only change is in the save and load tests) and you'll see. I didn't change anything else but the tests still pass, so I suspect there's something going on with the way you are using your database.

Remember, the latest changeset uses a memory database as the default driver which is what most people will not want, so you need to pass in a new IsolatedStorageDriver() on the database construction to get the same behavior. This will be in the release notes/etc. and there is a reason (because Sterling will be on the desktop and other areas that don't have access to the same isolated storage classes, so they can no longer reside in the core project).

If you are still having issues feel free to use the contact form on the website for email and we can figure out a way for me to help you troubleshoot further.

Mar 23, 2011 at 6:02 PM

Thx Jeremy.

The hint of your new driver model was enough to get it flying again. The Default in memory driver was indeed the problem...

Thats the bad side if you are using the up to date code which is not fully released ^^.