dcsimg
Sharing singleton objects across JVMs
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   rajneesh_kumar
Posted On:   Monday, June 7, 2004 11:02 PM

Hi

In one of our testing envt we have two solaris boxes running WAS 3.5. I need to share a singleton object across both the boxes.



Is there are mechanism provided by WAS that common data across boxes be shared or any wayout using RMI/JNDI so that both boxes share the same object.
Evenif each has its own personal copy,is there some mechanism for updating the change in one to other?

Rajneesh

Re: Sharing singleton objects across JVMs

Posted By:   Vishal_Gandhe  
Posted On:   Wednesday, August 4, 2004 12:37 AM

Guys,



Can't we use the web services or the RMI client for resolution of this issue. Suppose our singletone object resides on one JVM and access to the object is done through the web services or the RMI client running on diffrent JVM. I am not pretty sure weather this actually solves your problem Rajneesh, but can definately provide some alternative. Am I right guys?



-Vishal

Re: Sharing singleton objects across JVMs

Posted By:   Bhagyashree_Jayaram  
Posted On:   Thursday, June 24, 2004 08:43 PM

Hi,


Definately you can share the singleton object across JVMs.To do that you need to bind the singleton object to a JNDI registry and use the same registry to make a lookup.


If it is available you use the same else you create a new one and bind it.



Hope this helps....


Bhagya

Re: Sharing singleton objects across JVMs

Posted By:   Andrei_Melejik  
Posted On:   Friday, June 11, 2004 07:38 AM

  • Use the third host with Windows OS installed.
  • Develop and run COM service on it (your singleton object).
  • Use jni (jglue) to access COM service from solaris boxes with java.
  • Re: Sharing singleton objects across JVMs

    Posted By:   Sean_Owen  
    Posted On:   Wednesday, June 9, 2004 10:16 AM

    No, there is no way to do this. You'll have to come up with another way to synchronize data between the two instances, like by putting it into the database, or else re-consider whether you really need the Singleton pattern, and exactly one instance across all machines. Maybe you don't actually need that.
    About | Sitemap | Contact