Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile - which mode?  RSS feed

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

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?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!