I need to maintain a simple counter that is unique within the application, for all users and all nodes in a clustered environment. I thought about using the singleton sessio
Ha singleton is an approach. As an advance, there are some limitations. If you read, you will have a @stateless bean that access to the service through a "getValue()" method. The get value calls a singleton bean's methods and gives to you a value... all right until there.
But if you need to operate with the bean, a strategy should return a SingletonBean instance through get value, but.. you will have more instances of that singleton bean .... and there is the problem.