Hello all,
Is it possible to use JNDI based naming service (
J2EE appserver's) as a storage for identifier variables for Singleton objects in J2EE based cluster?
I have a following problem:
- I have a cluster with 4 nodes
- Each node has a it's own singleton instance (per JVM in cluster)
- I need a identifier to give a "identity" to each singleton instance In this way each singleton instance could read data from
database and cache it. Purpose is, that identifier would be also a primary key in database. In this way each singleton could read it's own group of data from database, so I would not need to do any synchronization between singleton instances (each singleton would
contain different data, that accpeted in my case).
The question is:
Is it possible to use JNDI/naming servive as "temporary storage" for those identifiers? Identifiers should be read every time when all the nodes in the cluster are booted. They should also be marked as used so,
that only one singleton would use it's own id.
When the cluster is rebooted those ids should be available again.
If I thing this problem with database technique, the problem is to "mark" ids as free when nodes in the cluster are rebooting...
can JNDI handle this better?
Thanks