• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlets / JavaBeans / Thread problem

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guyz:
any help with following wuld be appreciated
for(int i=0;i<20;i++)
{
someBean bean = new someBean();
bean.set(someArguments);
bean.doStuff();
Thread.sleep(1000);
SOP(bean.getResults());
}
the bean.doStuff() creates a socket connetion to an AS/400 system sends
input usin xml & gets back results usin xml(dont bother bout what bean does..i beleive problem on java/tomcat server side)
the SOP works only if the Thread stmt is used & when the thread values r around 1000.. System crashes when we have more loops or when we move program to a faster machine..in both these cases the programs responds back when we increase sleep time to 2000..3000 or more..
any suggestions / ideas ???!!
thanks
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You say that your bean.doStuff() opens a socket connection. Is there a specific reason that you need to open and close the socket each iteration? Is it possible to open the socket connection, iterate through, then close the connection?
I may be missing the point, but without too much information with what you intend to do, this is my first thought.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic