Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Precision concerning Stateful and Singleton beans

 
Mehdi Singer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm quite new to EJB's and I'd like to have a precision regarding stateful and singleton beans. Consider following code:


Can I consider that my list beans will ALWAYS contain different instances of BeanB? Or is my singleton BeanA considered as a single client and then will fill my array with 5 identical instances of BeanA? I've tested and it seems to me that the instances are different but I'd like to make sure that it will always be the case...

Thanks for your help !
 
Andrew Moko
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember when doing a jndi lookup, the client doesnt access/ call the remote object directly. The client creates a stub which communicates with the server skeleton (with a reference to the remote object). My best guess is with each lookup comes a seperate/ new stub??

I'd be interested in what other ranches have to say about this..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic