What about moving the map of locked
documents to a central database?
Then you could have any number of clustered
instances of that class and, all of them, could use the database locking
mechanisms to avoid synchronizing problems.
Salutacions/Saludos/Regards,
David Berenguer Vargas - IBM Global Services
Diagonal 571, 08029-Barcelona, Spain
Phone: 34-93-4018100
E-Mail: dberenguer@es.ibm.com
"Varun Rally, Noida"
<varunr@NOIDA.HCLTECH.COM>
Sent by: An interest list for Sun Java
Center J2EE Pattern Catalog <J2EEPATTERNS-INTEREST@JAVA.SUN.COM>
12/02/2004 10:09 AM
|
Please respond to
An interest list for Sun Java Center J2EE Pattern Catalog |
|
|
To
| J2EEPATTERNS-INTEREST@JAVA.SUN.COM
|
|
cc
|
|
|
Subject
| Re: Singleton in clustered
environment |
|
My requirement is that I need only one single
instance for the whole application in clustered environment.
i.e. even if there are more than one JVMs
, all of them should access single instance.
Exact requirement is that we have a class
that handles the locking functionality of documents in our
Application. We create only one singleton
object of this class and this object maintains a map of locked documents.
Now, in clustered environment, there will
be more than one JVMs and hence more than one objects that are handling
The locking information, which is actually
wrong.
I hope I am clear in my words.
Waiting for your reply.
Thanks and regards
Varun Rally
From: An interest list for Sun Java
Center J2EE Pattern Catalog [mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM]
On Behalf Of Tubman Aharon
Sent: Thursday, December 02, 2004 1:52 PM
To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM
Subject: Re: Singleton in clustered environment
I agree with Mall.
It is bad practice to access singleton remotely. Can you describe the meter
of you problem? Which kind of service it provides?
From: An interest list for Sun Java
Center J2EE Pattern Catalog [mailto:J2EEPATTERNS-INTEREST@JAVA.SUN.COM]
On Behalf Of Mall, Vishnu (Cognizant)
Sent: Thursday, December 02, 2004 8:08 AM
To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM
Subject: Re: Singleton in clustered environment
Hi Varun,
The Concept of Singleton is
"one and only one instance of a class at any given point of time in
a single JVM". The moment you mention a clustered environment, you
would end up having multiple JVMs and hence each JVM would have an instance
of this Singleton class. Hope this helps. Do let me know your exact requirement
in detail.
Thanks and Regards,
Vishnu Mall
Cognizant Technology Solutions,
Technocomplex, Kolkata
Ph : 2357 3211/12/13 Extn : 3253
email : MVishnu@cal.cognizant.com
-----Original Message-----
From: Varun Rally, Noida [mailto:varunr@NOIDA.HCLTECH.COM]
Sent: Thursday, December 02, 2004 11:03 AM
To: J2EEPATTERNS-INTEREST@JAVA.SUN.COM
Subject: Singleton in clustered environment
Hi all,
I have to implement singleton in clustered
environment.
Can somebody, help with some online resource/link
or pattern for doing the same.
Regards,
Varun Rally
====================================================================
Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com
ההתכתבות עם לאומי
באמצעות דואר אלקטרוני הנה לצרכים כלליים
בלבד ואין להסתמך עליה לשם ביצוע פעולות
ו/או עסקאות כלשהן ו/או כתחליף לייעוץ ו/או
בכל אופן אחר והיא כפופה לתנאי השימוש שנמסרו
ללקוח
Correspondence with Leumi by
electronic mail is for general purposes only and may not be relied upon
for the purpose of effecting any activities and/or transactions whatsoever
and/or as a substitute for advice and/or in any other manner and is subject
to the conditions of use which have been provided to the Customer
This e-mail and any files transmitted
with it are for the sole use of the intended recipient(s) and may contain
confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply
e-mail and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing
or copying of this email or any action taken in reliance on this e-mail
is strictly
prohibited and may be unlawful.
Visit us at http://www.cognizant.com |
====================================================================
Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com
==================================================================== Companion
Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com
==================================================================== Companion
Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@java.sun.com