> We have a DataCollector which collects and stores
> data periodically. So this class should have only one
> instance (or else data will be duplicated in the
> DB).
>
> Anyone any idea?
google "Java Singleton" and you should get three methods of creating a singleton.
Be careful with singletons.
They tend to be non-scalable (doesn't work in a load balanced environment, not without special care), and are usually a horrible source of trouble for garbage collectors (they tend to collect huge amounts of data and GC's need some time to sweep through) causing temporary noticeable web application freezes.
Why not just working in the regular EJB/3 domain?