How2 Flush to Disk DataSet.WriteXML(FileName,XMLWriteMode.WriteSch



VB.Net 2003
Windows Form Application.
A user session consists of long transactions (15- 30 minutes) where data is
stored locally in memory and then submitted to the server at the end of the
transaction for permanent storage. The problem is that if something goes
wrong with the client machine or application the memory data is lost. The
data is stored locally in a dataset. Our solution is to frequently do a
DataSet.WriteXML(FileName,XMLWriteMode.WriteSchema). This works very well in
all situations except one so far. (If the applications crashes, the XML file
is available on the local disk and we have routines to recover it and pick up
where the user left off. (That's what we want). If the computer crashes,
again, the XML file is there. But if the application and/or machine locks up
(or appears to lock up) and the user performs an End Task on our application
from the task manager, the XML file is not written. Note: To test, I can see
the FileName.xml file exists after the first execution of writexml but the
size is 0 bytes (Per Windows Explorer). It stays 0 bytes no mattter how large
in memory it becomes. (Alt Tab to toggle between the app and Explorer -with
refresh always shows 0 bytes). Even though Explorer says 0 bytes, if I then
pull the plug on the PC, the XML file is actually saved to the local disk.
But if I CTL+AlT-Del and say end task from the task manager, the XML file is
Not saved to disk. (That confuses me). But in any event, I assume that if I
could flush the streamwriter(?)/XMLTextWrite after each WriteXML the problem
would be solved. Unfortunately, I can't figure out how to do so. I have tried
to DIM as seprate XMLWriter but when I write to the same writer multiple
times I then can't read it for recovery purposes becuase it appends the
entire dataset each time instead of just the new data since the last write.

I would greatly appreciate any help you can offer. I am not locked in to the
XML soultion, it just works well considering the clients don't have an
alternate database they can use and the current code is simplistic and runs
relatively fast.

Thank you
--
Jim
.



Relevant Pages

  • Re: Support of a large table
    ... >> display different parts within different controls of a vb app. ... >> One part of the XML file identifies information about processor cylces. ... >> demanding on memory. ... > Try to open it in vb with DOM first. ...
    (comp.lang.basic.visual.misc)
  • Re: Online, Offline, Disconnected applications.
    ... XML file, ... Using MSDE is the best way. ... I've looked at both the TaskVision application> and the Offline Application Block for for guidance. ... My main concern here is the scalability,> efficiency, and memory usage when the application is running. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: remoting object access information from local xml file frequen
    ... it is efficient in using memory .. ... will it hold data in IIS memory automatically after retreiving from the ... > I would do is create a class that loads the xml file settings into the ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: XmlDataDocumentDataSet Memory Footprint, Feedback appreciated.
    ... I suggest you use a memory profiler to track where your memory is consumed. ... > size of the xml file would be greatly appreciated. ... > namespace DataExtract ...
    (microsoft.public.dotnet.languages.csharp)

Loading