dev@glassfish.java.net

Glassfish clustering question: how to make a java object shared across clustered server instances?

From: Jim Fu <Jim.Fu_at_Sun.COM>
Date: Mon, 23 Mar 2009 09:33:11 -0700

I am using java.util.concurrent.ReentrantLock to synchronize threads on
a JVM.
when the application is deployed to a cluster, the lock instance is per
server instance, meaning only threads running on the same instance can
be synchronized by the lock instance.

is it possible to make the lock instance 'global' to the server instances?

BTW, tried to put the lock registry class (a singleton with a static
HashMap inside) in system class path hoping that it will be a global
registry accessible to both server instances in the cluster, but the
runtime debugging shows that it is still a per server instance reference
(indicated by different hashcode).

is this achievable under glassfish v2.1 clustering?

thanks in advance

Jim