Hi, I have a question regarding the usage of multiple servetls vs. single generic servlet to handle XML transformation on a webapp.
I have a program that convert several XML format to a various output formats. Currently I'm using individual servlet to handle the transformation. (servlet1 to transform format 1, servlet2 to transform format 2, servlet3 to transform format 3, etc) Code snippet of each servlet below:
JDOMSource in = new JDOMSource(sourceDoc);
JDOMResult out = new JDOMResult();
Transformer transformer = TransformerFactory.newInst
ance()
.newTransformer(new StreamSource(stylesheetSys
temID));
transformer.transform(in, new StreamResult(outputFile));
It works fine except in the high usage load in transforming concurrent XML. Each of the thread takes a long time to complete. Eventually some of them got stuck. My WebLogic stuck limit was increased to 20000 seconds.
Would consolidate all servlets into a single generic transform servlet improve the performance? I didn't plan to test this yet until I hear from more experienced programmers about the correct technique to program. It takes quite a bit of code changes to consolidate them. From the OOP stand point it make sense to consolidate.
I'd like to hear opinion about the thread efficiency, memory consumption and other important considerations.
Thank you!
Owon. S
Start Free Trial