[jboss-user] [EJB 3.0] - How to create singletons?

aidndev do-not-reply at jboss.com
Fri Nov 16 18:20:08 EST 2007


We need to create singleton classes to cache database data.  Using an EJB container we are not guaranteed that truly one object is being instantiated and shared.  I have heard various answers to this, including some mysterious "well, it depends on the classloader..." answers.  From what I have found online, the answer appears to have something to do with declaring the class final, or using @service, but I don't know if these are definitely the solution.  How can we make a singleton that is definitely really a singleton?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105694#4105694

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105694



More information about the jboss-user mailing list