Now in order to read it must of course manipulate my file handle (raf), which I only have one of, and this of course spells out synchronization. But, it manipulates the file handle indirectly by calling
"this.getContractor(recordNumber)" which IS synchronized and by the way called by other methods. My question is do I still synchronize on the whole read method ?
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
Is that significantly different from what you do in getAllContractors()? I can imagine ways that getAllContractors() might be optimized to read a bunch of contractors more efficiently, but my gut feeling is it's probably not a big difference.
I'm thinking that whatever logic that went into getAllContractors() in the first place can just go here instead. Does getAllContractors() need to be called rom anywhere else?
"I'm not back." - Bill Harding, Twister
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|