wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Singleton Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Singleton Pattern" Watch "Singleton Pattern" New topic
Author

Singleton Pattern

Balaji Nagarajan
Greenhorn

Joined: Jul 15, 2002
Posts: 4
How do i implement a Singleton in a J2EE application(for server side classes)?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
This is a common question to which there is no standard answer as far as I know. The problem is that the application may reside in a clustered environment made of several JVMs.
Here are some resources related to the subject:
J2EE Singleton pattern at TheServerSide.com
JBoss clustering / singleton services
J2EE singleton by javaspecialists.co.za


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gustavo Adolpho Bonesso
Ranch Hand

Joined: May 11, 2002
Posts: 103
I agree with Lasse, but if you are in a enviroment with a single JVM, the Singleton Pattern is usefull to make DAO�s (Data Access Objects).


Gustavo Adolpho Bonesso<br />SCJP1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singleton Pattern
 
Similar Threads
Tech Word Game
Creating a utility managed bean, to move common code and use from different beans?
Single pattern
Hashtable's put method problem in locking
singleton class