简体   繁体   中英

Performance issue while reading XML File in Java and storing it in Database

Hi I have big xml file which has a structure similar to the one I have given below and there are 1 lakh users in each XML file . I am uploading as a zip file and then I am extracting it . Once Extraction is done I am providing a Import link. what import does is it reads the XML file which has 1lakh(100000) users and then inserts into DB . I am using Spring with hibernate and have quartz job scheduler . I am uploading 10 such files and I am starting these 10 jobs which totally consists of 1 million lakh users.the jobs stops in the middle . I am not sure why the job stops and i see no trace of the job stopping . Please help me in resolving this . Is there a better way to read the XML , or anything to do with hibernate transactions or sessions. Please help. I am using java,spring, hibernate,quartz job scheduler.

<userlist application="1">
<user>
<username> xmluser1 </username>
<userid>1</userid>
<password>xmluser1</password>
<firstname>first1</firstname>
<lastname>last1</lastname>
<phone>2024676868</phone>
<fax>20246868</fax>
<address1><![CDATA[dghggggh]]></address1>
<address2></address2>
<city>ghgdghg</city>
<state>fdghg</state>
<country>UdghgSA</country>
<postal_code>774dghg07</postal_code>
<company>dghggg services</company>
</user>
</userlist>

I suggest, you are inserting data from 10 different jobs to same table, is any db table locking taking place. You can try lowering isolation level. Which database are you using. May be this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM