• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database file access

 
Mike Ngo
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"You may assume that at any moment, at most one program is accessing the database file"

Can I assume that, at any given time, at most one instance of the client or server is running and has exclusive access to the file? Do I need to prevent the examiner from attempting to run two instances of the server for example?
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Ng:
"You may assume that at any moment, at most one program is accessing the database file"

Can I assume that, at any given time, at most one instance of the client or server is running and has exclusive access to the file? Do I need to prevent the examiner from attempting to run two instances of the server for example?


I think it is fair to assume that there is at most one instance of your data class running at any time. For example you cannot be expected to prevent a situation where a local client has a file open and a seperate server instance has the same file open as they would be running in seperate JVMs. I don't even think that it would be possible to stop this without using platform specific file locks.

The only case to worry about is where there are multiple network clients using the same server instance, which is most likely exactly what you have done anyway.

Mark.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic