Commit 928aa149 authored by skhan's avatar skhan

change for try catch in while loop as told by s manoharan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91091 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a3e2ae03
......@@ -176,38 +176,56 @@ public class DownloadCSVBatchBean implements Schedule
while( tranItr.hasNext() )
{
tranId = ( String ) tranItr.next();
dnldFileName = ( String )tranFileMip.get( tranId );
xmlToCsvStr = client.getTranXml( "invoice",
java.sql.Timestamp.valueOf( "2008-11-01 00:00:00" ),
java.sql.Timestamp.valueOf( "2008-11-01 00:00:00" ),
tranId, tranId, conn );
csvData = csvConverter.convert( xmlToCsvStr,
CommonConstants.JBOSSHOME + File.separator + "DOWNLOAD"
+ File.separator + "template"
+ File.separator + templDnld + ".xml",
null
);
FileWriter fw = new FileWriter( downloadLoc + File.separator + dnldFileName + ".csv" );
try
{
fw.write( csvData );
tranId = ( String ) tranItr.next();
dnldFileName = ( String )tranFileMip.get( tranId );
xmlToCsvStr = client.getTranXml( "invoice",
java.sql.Timestamp.valueOf( "2008-11-01 00:00:00" ),
java.sql.Timestamp.valueOf( "2008-11-01 00:00:00" ),
tranId, tranId, conn );
csvData = csvConverter.convert( xmlToCsvStr,
CommonConstants.JBOSSHOME + File.separator + "DOWNLOAD"
+ File.separator + "template"
+ File.separator + templDnld + ".xml",
null
);
FileWriter fw = new FileWriter( downloadLoc + File.separator + dnldFileName + ".csv" );
fw.close();
fw = null;
pstmt.setString( 1, tranId );
pstmt.addBatch();
fw.write( csvData );
fw.close();
fw = null;
//Changed by Rupali [update the Download_flag after each invoice files downloading].Start
//pstmt.addBatch();
pstmt.setString( 1, tranId );
int rowCnt = pstmt.executeUpdate();
if(rowCnt >= 1){
conn.commit();
}
else{
conn.rollback();
}
}catch( Exception ex )
{
//ignore this exception as if one file throws exception next file should download.
}
//Changed by Rupali [update the Download_flag after each invoice files downloading].End
}
pstmt.executeBatch();
//Changed by Rupali [update the Download_flag after each invoice files downloading].Start
//pstmt.executeBatch();
pstmt.close();
pstmt = null;
/*
try{
conn.commit();
}catch( Exception ex ){}
*/
//Changed by Rupali [update the Download_flag after each invoice files downloading].End
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment