The Artima Developer Community
Sponsored Link

Java Answers Forum
Will singleton work in multiple Vms

1 reply on 1 page. Most recent reply: Sep 19, 2002 9:41 AM by Don Hill

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Babu Reddy

Posts: 7
Nickname: babureddy
Registered: Jun, 2002

Will singleton work in multiple Vms Posted: Sep 18, 2002 4:17 AM
Reply to this message Reply
Advertisement
Will the Singleton implementation work if Apllication is deployed on a machine having multiple Virtual machines


Don Hill

Posts: 70
Nickname: ssswdon
Registered: Jul, 2002

Re: Will singleton work in multiple Vms Posted: Sep 19, 2002 9:41 AM
Reply to this message Reply
Are you referring to seperate JVM, in that case no, remember there can only be one instance per jvm, the pools aren't shared accross VM. Take the case of a static method, there is one copy per JVM so if I have JVM one do a set on a static method and JVM 2 call a get, the value won't be there be cause the object pools are different.

You would need to create some other type of persistance mech to do this ie:persist to db or file system.


HTH

Flat View: This topic has 1 reply on 1 page
Topic: elevator Previous Topic   Next Topic Topic: How do I Extrract strings from HTML page like Price of a book ?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use