Error When using database already in IsolatedStorage

Jan 11, 2011 at 8:15 PM

First off, I love this project!  Thank you so much for all your hard work and effort!

I was using a version you had previously made available from your blog (No blob or boolean support) so I upgraded using the source found here.  However, this caused my app to no longer work.  I am using a database file copied to IsolatedStorage and this seems to be causing the issue.

I tracked the problem down to the os_win_c.cs file line 795.  Changing this line:

pFile.fs = new IsolatedStorageFileStream(zConverted, dwCreationDisposition, dwDesiredAccess, dwShareMode, pFile.store);

to this:

pFile.fs = new IsolatedStorageFileStream(zConverted, FileMode.OpenOrCreate, dwDesiredAccess, dwShareMode, pFile.store);

fixes the issue for me.  I noticed in my previous version that this is closer to what was used before.  Is this a bug or am I doing something wrong?

Thanks,

-Chris Kent

Aug 12, 2011 at 9:03 PM
Edited Aug 13, 2011 at 12:02 AM

Hi Chris

That helped me a lot, thanks! There is another problem: the FileStream is not closed properly, so the database cannot be deleted or replaced without closing the complete app. Do you know where to add the pFile.fs.Close command in the source code?

Edit: Seems to be a mulitthreading bug in my own code. Looks like the stream is closed correctly in the library.

Thank you!