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

RandomAccessFile - which mode?

 
Dan Murphy
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my design I have multiple instances of Data, each of which uses a RandomAccessFile to read the database file. It seems to me that using RandomAccessFile mode "rws" (or "rwd") rather than "rw" will greatly simplify concurrent file access, when there are multiple instances of RandomAccessFile writing to the same file, because a client knows that as soon as a file-updating method has returned, other clients will be able to see the changes. But the consensus in this thread seems to be that "rw" is sufficient, can someone explain why?

Cheers,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic