HighTechTalks DotNet Forums  

DataSet WriteXML aborts

Dotnet XML microsoft.public.dotnet.xml


Discuss DataSet WriteXML aborts in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ralf Mayer
 
Posts: n/a

Default DataSet WriteXML aborts - 11-06-2006 , 09:20 AM






Hello!

I did search for this one quite a while, but I cannot seem it mentioned
anywhere, so let me ask here if someone saw this problem before. The
behaviour is confirmed (for me) with Framework Version 1.1 (with all patches
for the version applied)

I read and write data for an XML file into a dataset, the file is around 13
MB, and contains one table with around 1000 entries (rows) with maybe 12-15
fields, the fields are sometimes a bit longer with maybe 1000 chars. Sounds
not to complicated as a structure.

Well, what happens on ds.WriteXML is that the writing just cuts off
somewhere. No exception thrown, nothing, program flow continues as if
nothing had happened. It looks something like this:
<table>
<field1>This is the text for field1</field1>
<field2>This is the tex

And that is it. The writing stops right within one tag. You only notice the
error next time you want to read the file again.

It happens only very very seldom, maybe once in 100 writes. It is also not
bound to a specific row or data content, it just happens somewhere on the
way.
Sadly, I have not been able to reproduce it myself, I only know by clients'
complaints. So I cannot say how the dataset looks in memory after the error
occured, if it is still valid or corrupt after the point the writing
stopped.

It looks as if the last buffer has not been flushed out of memory into the
file. I did make sure it is on a media that is not removeable, sufficient
disk space is there, the file written to has time to get closed in orderly
fashion...

Anyone ever seen that?



Reply With Quote
  #2  
Old   
Zero
 
Posts: n/a

Default RE: DataSet WriteXML aborts - 10-18-2007 , 10:43 AM







Quote:
Hello!

I did search for this one quite a while, but I cannot seem it mentioned
anywhere, so let me ask here if someone saw this problem before. The
behaviour is confirmed (for me) with Framework Version 1.1 (with all patches
for the version applied)

I read and write data for an XML file into a dataset, the file is around 13
MB, and contains one table with around 1000 entries (rows) with maybe 12-15
fields, the fields are sometimes a bit longer with maybe 1000 chars. Sounds
not to complicated as a structure.

Well, what happens on ds.WriteXML is that the writing just cuts off
somewhere. No exception thrown, nothing, program flow continues as if
nothing had happened. It looks something like this:
table
field1>This is the text for field1</field1
field2>This is the tex

And that is it. The writing stops right within one tag. You only notice the
error next time you want to read the file again.

It happens only very very seldom, maybe once in 100 writes. It is also not
bound to a specific row or data content, it just happens somewhere on the
way.
Sadly, I have not been able to reproduce it myself, I only know by clients'
complaints. So I cannot say how the dataset looks in memory after the error
occured, if it is still valid or corrupt after the point the writing
stopped.

It looks as if the last buffer has not been flushed out of memory into the
file. I did make sure it is on a media that is not removeable, sufficient
disk space is there, the file written to has time to get closed in orderly
fashion...

Anyone ever seen that?

I have EXACTLY the same problem. In clientīs pcs i get an error opening the file, and it is in that state.. truncated. But, the file is filled with null values at the end. Eg.: If the file size is 2MB, i have 1.3 MB of data (xml) and then null values (0x00) till end.

The curiuous thing is the size of XML part of the file: is a multiplier of 8K. I supossed a cache problem,. but i didnīt probe it yet.

The change was append the "WriteTrhought".

My original code:

datos.WriteXml(archivo, XmlWriteMode.WriteSchema);

the changed code:

using (FileStream st = new FileStream(archivo, FileMode.Create, FileAccess.Write, FileShare.None, 8192, FileOptions.WriteThrough))
{ datos.WriteXml(st, XmlWriteMode.WriteSchema);
}

If you can solve the problem, please let me now.

Thanks in advance.

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.