W3C home > Mailing lists > Public > www-ws@w3.org > October 2004

Re: Stateful Web Services...

From: <Joachim.Peer@unisg.ch>
Date: Wed, 27 Oct 2004 15:39:21 +0200
To: Cristóvão Bento <cbento@criticalsoftware.com>
Cc: <www-ws@w3.org>
Message-ID: <OF6771FA04.B7121B50-ONC1256F3A.004AB001-C1256F3A.004B0386@unisg.ch>

> Although there is one last thing that is confusing me. A Web Service
> life is controled by a Web Server like for example Tomcat. When a 
> request arrives, the class that implements the request is 
> dynamically loaded and the request is executed. When the request 
> ends the class is deallocated. This means this class cannot maintain
> its internal state. Any kind of data that was kept by it is garbage 
> collected. 
> 
> One of my questions is: 
> 
> Is it possible now to design a Web Service that is automatically 
> allocated when the user makes a request, and is only 
> deallocated/stops running when i want? This means that it will run 
> while the Web Server (Tomcat) is running.
> 

one way to deal with that is to store all session data in some life-cylce 
independent place, e.g. in
- a relational database,
- a naming/directory service (e.g. JNDI, Apache Commons Discovery, ...)
- static varibles fields of your class

hope this helps,
Joe
Received on Wednesday, 27 October 2004 13:39:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 July 2007 12:25:46 GMT