Hi -
The below code published some content into the database. I need to turn this code into a mutithreaded code so that the operation happens fastly. And the reason i need to have this is because my lineid[] contains more than 5000+ values.
public class PublishPropertyObjects {
public static void main(String[] args) {
String lineId[]={"4983462","12321
34234","12
34214","12
34214","12
342134"};
String localeCd = "de-DE";
System.out.println("Length
: "+lineId.length);
for(int i = 0 ; i < lineId.length ;i++){
try {
ServiceInvocation serviceInv = ServiceInvocation.getInsta
nce();
PDNAGlobalLinkPort proxy = (PDNAGlobalLinkPort)servic
eInv.creat
e(PDNAGlob
alLinkPort
.class);
ApproveTranslationRequestD
TO reqDTO = new ApproveTranslationRequestD
TO();
reqDTO.setRequestContextBe
an(Mercury
Util.build
RequestCon
text());
reqDTO.setItemId(new Long(lineId[i]).longValue(
));
reqDTO.setLocalCode(locale
Cd);
boolean success = proxy.approveTranslation(r
eqDTO);
if(success)
System.out.println(i+" "+lineId[i] + " " + localeCd +" -->>> approved");
else
System.out.println(lineId[
i] + " " + localeCd +" failed to approve");
}catch (Exception e) {
System.out.println("Except
ion -->> "+e.getMessage()+ ">> has been generated");
}
}
System.out.println(">>>>>>
>>>>>>DONE
<<<<<<<<<<
<<<<<");
}
}
Is this possible?
Thank you
Start Free Trial