Advertisement

12.12.2007 at 12:10PM PST, ID: 23019431
[x]
Attachment Details

Multiple servlets vs. single generic servlet to handle XML transformation

Asked by owonseed in JAXP & SAX (XML APIs), BEA WebLogic Application Server, Extensible Stylesheet Language Transformation (XSLT)

Tags: , , ,

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.newInstance()
                  .newTransformer(new StreamSource(stylesheetSystemID));
              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
 
Loading Advertisement...
 
[+][-]12.16.2007 at 08:56PM PST, ID: 20482995

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JAXP & SAX (XML APIs), BEA WebLogic Application Server, Extensible Stylesheet Language Transformation (XSLT)
Tags: multiple, servlet, vs, single
Sign Up Now!
Solution Provided By: sompol_kiatkamolchai
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.10.2008 at 02:03PM PST, ID: 20631803

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628