Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

DataSet Reading Problem in Thread

$
0
0

I have the Bulk XML Doument which has 10000 students record (assumption) as follows:

<school>

<student count=1>

<name>Sam</name>

<age>14</age>

<parents>

<father>Anderson</father>

<mother>Anah</mother>

</parents>

<marks>

<internal1><eng>68</eng><mat>78</mat></internal1>

<internal2><eng>67</eng><mat>89</mat></internal2>

</marks>

</student>

....

....

<student count=10000>

<name>John</name>

<age>18</age>

<parents>

<father>Abraham</father>

<mother>Sana</mother>

</parents>

<marks>

<internal1><eng>68</eng><mat>78</mat></internal1>

<internal2><eng>67</eng><mat>89</mat></internal2>

</marks>

</student>

</school>

i'm splitting these bulk 10000 students record into 500 students record of 20 xml files. then am creating 20 thread for 20 xml files. in each thread am traversing the values from xml and constructing dataset which contain 6 tables as folows:

StudentName

StudentInternalMarks1

StudentInternalMarks2

StudentFatherName

StudentMotherName

StudentAge

To fill the values in 6 tables i use 6 functions as follows:

ReadStudentName(dsStudentDetails);

ReadStudentInternalMarks1(dsStudentDetails);

ReadStudentInternalMarks2(dsStudentDetails);

ReadStudentFatherName(dsStudentDetails);

ReadStudentMotherName(dsStudentDetails);

ReadStudentAge(dsStudentDetails);

At a time only two thread will run. if any one of thread ends means, remaining thread and 3rd thread will run. Each thread in a dataset will contain 500 students record. if i run it as sequence means(one by one), all 10000 students record will be loaded. if i run it in thread mode means,in some thread some values are not loading. (i.e.,) some values are missing. for e.g.: among 10000 only 9258 are loading. this could be change every time.


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>