Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI nameservive as a temporary storage in cluster  RSS feed

 
mik laan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This topic makes more sense in the EJB forum, so I'll move it there.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!