Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

singleton stateless session bean in EJB 2.0

 
Ravi Bansal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to have singleton session bean in EJB 2.0 by applying the singleton pattern on session bean ? will there be any issues with this ? or its totally upto the container to manage the number of bean instances ?

I know EJB 3.0 have provided some special annotations to specify the session bean as singleton . Just wanted to know if something similiar is available in EJB 2.0
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. The closest you could get is to have a stateless session bean with a pool size of 1. But you shouldn't be storing things in that bean anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic