• Post Reply Bookmark Topic Watch Topic
  • New Topic

Singleton and session  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a singleton class
If each new session wants to have the instance of this class should this class be shared amongst all new sessions or all sessions can have separate instance of this class

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Separate instances" and "singleton" do not go together. If it's truly a singleton, there can be only one instance per JVM. If you need separate instances, it can't be a singleton.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!