HI!
Can we define a synchronized block in service method of servlet.What will happen?Generally to make our servlet thread saf we will implement singleThreadModel interface which is nothing but synchronizing.If we do the same in service ie.,defining synchronied block in service.What'll happen?
Regards.
Vijaya.
-
Can service method be synchronized (2 messages)
- Posted by: vijaya lakshmi
- Posted on: March 02 2004 01:53 EST
Threaded Messages (2)
- Its possible to synchronize the service method by N Naresh Kumar on March 02 2004 07:03 EST
- Its possible to synchronize the service method by vijaya lakshmi on March 03 2004 05:08 EST
-
Its possible to synchronize the service method[ Go to top ]
- Posted by: N Naresh Kumar
- Posted on: March 02 2004 07:03 EST
- in response to vijaya lakshmi
Hi!
If service method is synchronized instead of using SingleThreadModel interface by synchronizing the block some of the variables like session variables and static variables cannot be accessed by dirferent threads simultaneouly
If you use SingleThreadModel it will not guarantee the synchronization of these variables
Any suggestions or queries mail to me at nnareshkumar at seznam dot cz
Thanks,
N.NARESH KUMAR -
Its possible to synchronize the service method[ Go to top ]
- Posted by: vijaya lakshmi
- Posted on: March 03 2004 05:08 EST
- in response to N Naresh Kumar
ThanQ Naresh.
Regards.
Vijaya.