• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet pooling

 
app yadav
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can anyone please tell me where can i specify the size of pool for the servlet.

Thanks in advance.
Aparna.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You dont need to.

Actually, container doesn't really do pooling for servlet instances. There is a seperate thread for every request entertained by the same servlet instance. Container might create multiple instances of a servlet when it like to. You need not bother with this thing.

Thanks.
 
Sunny Kumar
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For more information discussing the similar issue you can have a look at Pooling of servlet thread.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[co-incidence]
Sunny and Ben, you both pointed to the same thread.
[ November 29, 2005: Message edited by: Adeel Ansari ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh!
He posted first so I'll pull mine down.
 
app yadav
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there is no way by which a programmer can specify the pool size if a servlet implements SingleThreadModel.This would be totally server specific.Am i right?

Aparna
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To the best of my knowledge, there isn't anything in the spec requiring servlet pooling. So, yes, this would be container specific.



SRV.2.2.1 Note About The Single Thread Model

The use of the SingleThreadModel interface guarantees that only one thread at a
time will execute in a given servlet instance's service method. It is important to
note that this guarantee only applies to each servlet instance, since the container
may choose to pool such objects. Objects that are accessible to more than one serv-
let instance at a time, such as instances of HttpSession, may be available at any par-
ticular time to multiple servlets, including those that implement
SingleThreadModel.
It is recommended that a developer take other means to resolve those issues instead
of implementing this interface, such as avoiding the usage of an instance variable or
synchronizing the block of the code accessing those resources. The
SingleThreadModel Interface is deprecated in this version of the specification.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic