JBoss Community

Clustering an application that uses Spring singletons

created by Alessandro Novarini in Beginner's Corner - View the full discussion

Hello all,

 

As the title says, I need to make an application deployed on a JBoss 5.1 ready for a cluster environment.

We're facing a problem with some stateless ejb, because they have actually a "state", a field that works like an internal cache for some data.

 

This field is injected by Spring, and it's configured as a singleton, so that every stateless bean instantiated keep the reference to the same object.

Now developers asked me advices about clustering this bean, so that that cache will be shared between all the ejbs on all nodes.

 

How would you solve this problem?

Making the state a stateful bean doesn't obviously work, and we don't like to put this cache on db because we have caching enabled for entity beans.

 

Thanks in advance

Ale

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community