Brian DiCasa
Brian DiCasa

Reputation: 9487

Sharing state in a Glassfish cluster

I'm new to Java EE 6 development and am planning on using Glassfish 3.1.2 open source edition. I need to share a simple map data structure across the cluster (needs to be replicated). I've been doing some research and a couple of strategies popped up when using JBoss AS:

One strategy would be to use JBoss Infinispan in Glassfish. However I'm wondering if Glassfish already has a built in mechanism for handling this type of thing?

If I used a Singleton bean with a Map in it, would that map be replicated across the cluster?

Thanks for suggestions.

Upvotes: 1

Views: 688

Answers (2)

Manik Surtani
Manik Surtani

Reputation: 396

JBoss Cache is in maintenance mode. I would recommend Infinispan instead, which is JBoss Cache's successor.

Upvotes: 0

John Clingan
John Clingan

Reputation: 3334

It depends on what you are trying to do. If you have high availability enabled, then any state in the HTTPSession or Stateful Session Bean is stored in a replica mode.

If you want to store data so that all nodes can potentially nodes can access data, then you can potentially utilize Shoal (http://shoal.javanet), which is the underlying mechanism that GlassFish uses to replicate high availability data.

Yes, you try using JBoss Cache, Infinispan, ehCache, memcached, etc, but the GlassFish team does not test those frameworks with GlassFish. We do test Oracle Coherence.

Good luck and I hope this helps.

Upvotes: 1

Related Questions