> I understand a singleton to be is a variable that is referred to only once.
A singleton is a class which is only instantiated once. It typically lives for the life of the application and services all threads. A singleton does not generally store any instance data specific to a given thread.
Examples of singletons in my app are all my services and DAOs. Even if 5 concurrent requests are each creating a separate transient user class, they are all injected with the same instance of my userDAO singleton.
Does that make sense?
As far as why you believe you are persisting your service in the session scope, but it seems to be handling requests from other sessions, I don’t have any answer for you. I would have to ask how you know it is being “shared”. That being said, even if it is, it would not be an issue if all the methods are thread-safe. (Using only variables local to that method)
Thanks!
~Brad