Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isLocked(int recNo) need to be synchronized ?

 
Ziji (Jay) Zhang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been reading posts here regarding locking implementation.
There are a few posts talking about isLockee() method.
I finally made my decision on how to implement this method,
but still have some dulbs need to be calarified.
1. I use a synchronizedMap to store recNo to clienID mapping.
Do I need to synchronize on isLocked() method? this method only check if
the record is in the map or not.

 
Ziji (Jay) Zhang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Data class I call this method,
but I also check if record is valid or not first,



Thanks,
Ziji
 
Ziji (Jay) Zhang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Data class I call this method,
but I also check if record is valid or not first,



Thanks,
Ziji
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic