IntelliJ Java IDE
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes writeRecord Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "writeRecord" Watch "writeRecord" New topic
Author

writeRecord

Thomas Mathai
Greenhorn

Joined: Apr 01, 2001
Posts: 9
Can anyone explain why the writeRecord method is NOT synchronized while all the other methods are?
vladimir levin
Ranch Hand

Joined: Dec 19, 2000
Posts: 45
the writeRecord() method is a private method of the Data clas.
It is only called by the public methods of the Data class, which
are synchronized. Therefore, since it will always be called
from a synchronized code block, there is no need to synchronize
this method.
Vlad
Thomas Mathai
Greenhorn

Joined: Apr 01, 2001
Posts: 9
Thanks Vladimir. But so is the readRecord method. It is private too, but it is synchronized. Isn't this inconsistent, if nothing else, from a style viewpoint?
 
 
subject: writeRecord
 
Threads others viewed
record locking vs table locking
Deprecated methods
writeRecord() in DataClass synchronized ?
modify method in Data Class
deprecated methods
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture