Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

locking question

 
Marijana Grabovac
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!!!
I have a dilemma and I need to verify some thing with you guys.
We are supposed to enable two connection modes for the database (local and remote). Everybody is assuming that lock and unlock are needed only in the remote mode. What if you had two users at the same machine running in the local mode? (you can have multiple users logged into the machine with telnet, for example). Aren't we supposed to manage locks in that case?
Thanks,
Maja
 
Daniel Chen
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marijana,
I also thought it as you before and I also put lock in local mode.However I found it was no use.I thought they were in the diffient jvm so I have no way to promise thread-safety.Then I gave up, only implemented in network mode.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maja,
Users are supposed to use the applications as they are designed for. If the user wants to share the data file with other PC which has the application running locally, it is his responsibility to take care of concurrency. Basically he is not supposed to use the application over the network by any means other than RMI.
I know people have passed the certification by implementing either way. My suggestion is to implement the locking in the LockManager and leave the methods empty in the Data class.
 
Marijana Grabovac
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your feedback!
You managed to persuade me to implement locking mechanism just in network mode.
Maja
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic