• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt on Stateless Sessinbean class level variable!  RSS feed

 
Seenu Reddy
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using stateless session bean. here i have doubt about the class level variable reference in the stateless session bean. see the code bellow. When the sever come up, container will maintain the Pool of objects for that bean. The server assign the first pooled object to the client x. now the Product p is null, so it executes the
Line 2. i.e., creates the new object. After execution the object releases and keep it in the pooled state. For the client y assign the
Same first pooled object what will be the my product value. Is it null or assigned object reference?
ex:
public class ABC extends SessinBean{
Product p = null;
public executeA(){
if (p == null){
p = new Product();//line 2
String prod = p.getProduct();
}
else
{
String prod = p.getProduct();
}
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!