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
posted
0
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
posted
0
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?