[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem parsing XML file with Xerces-J


xerces write xml file
another optimization strategy(which will further optimize my program,
in addition to suggestions Pete gave) strikes me..

My program(the most current version) has this high level structure -

  for(;;)
  {
       //1. Get XML from remote host
       
       //2. Parse it completely and create a bulkier XML response message

       //3. Send response to users : SenderHelper.send(xml_string);

       //4. Set pooling interval of 5 seconds
       Thread.sleep(5*1000); 
  }

Thats it basically..

I have a helper class SenderHelper which has a public static method
send(String xml)

SenderHelper.Send() does:
HTTPConnection con = new HTTPConnection("host"); //open HTTP
connection to remote host
HTTPResponse resp = con.Post("/service-url", form_data); //post to URL

If I make this statement "public static field" of class SenderHelper,
HTTPConnection con = new HTTPConnection("host")

Then it would not be created again-and-again for each invocation of
SenderHelper.Send() and a significant optimization will happen ..

BUT I have a doubt here.. 
If I make this statement "public static field"
HTTPConnection con = new HTTPConnection("host")

Would the HTTPConnection have some timeout? i.e. would it close after
some "inactive interval" ? If yes, can I make it infinitely
persistent..?

Any thoughts please?

Best regards,

> I implemented your suggestions in my application ..
> 1) Sending a bulkier message (there was a mechanism in the API) - now
> I am opening only 1 HTTP connection "per response" from remote
> service.
> 2) Reducing pooling interval to 5 seconds
> 
> Thank you (and to all who answered my questions) ..
> 
> I am happy with the performance of my application.
> 
> best regards,
> 
> >
> > > Pete
> > >
> > > ********************************************************************
> > > This email and any attachments are confidential to the intended
> > > recipient and may also be privileged. If you are not the intended
> > > recipient please delete it from your system and notify the sender.
> > > You should not copy it or use it for any purpose nor disclose or
> > > distribute its contents to any other person.
> > > ********************************************************************
> > >
> >
>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.