Friday, August 26, 2005 10:12 AM
Is it possible to implement the class as a POJO, which will remain as a singleton in a memory?
You can of course write code for this, e.g. as a static field in a class with a private constructor and a static "getInstance()" factory method, and experiment to see if it works.
I don't really use EJB's so I'm not sure, but I think (?) you might run into problems with different ClassLoaders etc., where various EJB instances might not all see exactly the same copy of this "singleton" over time? e.g. some (but not all?) of them might get their own separately loaded version, of your "singleton" ....
I think you're perhaps better off putting this in a database instead?