concurrency and web-services

Discussion in 'Java' started by Uli, Jul 3, 2003.

  1. Uli

    Uli Guest

    Hello!

    Does anybody know if there is a way to make a web-service concurrent?
    So that several clients can call at the same time a web-service. Is
    there a mechanism or a framework to enable this, or does one have to
    create a new thread each time the web-service is called?

    Uli
     
    Uli, Jul 3, 2003
    #1
    1. Advertising

  2. On 3 Jul 2003 06:26:51 -0700, Uli wrote:
    >Hello!
    >
    >Does anybody know if there is a way to make a web-service concurrent?
    >So that several clients can call at the same time a web-service. Is
    >there a mechanism or a framework to enable this, or does one have to
    >create a new thread each time the web-service is called?
    >


    I do not have much experience with webservices, but some in
    distributed object system. Making threads for each call/client
    is most likely allready done using the webservices-server (tomcat
    or whatever), I don't think you would have to deal with that.

    Furthermore, in Tomcat, webservices can have three types for livetime:
    application, session and request, with application an instances object
    keeps alive all the time and is used for all other request, with
    session only for the current user, etc.

    To make program work well with multiple threads accessing it at the
    same time (not a problem if a new object is created for every session
    or request), you can use the synchronized statement of java.
    If you put synchronized before a method, when the method is called
    no (other) method of the object can be called at the same time.
    This way you can avoid problems that can occur when to methods
    try to change the same object or variable.

    --
    Gerbrand van Dieijen

    WWW: http://twisted.warande.net
    ICQ: 19345450
     
    Gerbrand van Dieijen, Jul 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Homa
    Replies:
    1
    Views:
    467
    Alvin Bruney
    Nov 21, 2003
  2. Sami Vaaraniemi
    Replies:
    0
    Views:
    541
    Sami Vaaraniemi
    Apr 1, 2004
  3. Billy Jiggs
    Replies:
    0
    Views:
    463
    Billy Jiggs
    Apr 1, 2004
  4. Nick
    Replies:
    1
    Views:
    6,140
    Alvin Bruney - ASP.NET MVP
    Sep 12, 2005
  5. John
    Replies:
    4
    Views:
    452
Loading...

Share This Page