• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to protect object's state in distributed scenario

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii All,

In CORBA, I need to implement a mechanism which protects objects state when it is being accessed by remote objects.

I have an interface which lists a method increment() which is implemented as,

public synchronized int increment()
{ sum++;
return sum;
}

I am able to achieve the multiple clients access for this method when i m running it in a desktop. For that, i have synchronized the call to this method by keeping the servant object as a monitor.

But now i want to protect the state of the object when the remote objects are calling the same method.
Can anybody suggest about the approach i can follow to lock and unlock objects so that only one client can access/modify the state in distributed environment ?

I heard about two approaches
1) test and set approach
2) lock manager

It will be nice if i get a sample implementation of this..

Thanks in advance,
Vijay Bhore
Student, CA, USA

 
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic