• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data file changes while clients connected

 
Tom Nicki
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Has anybody thought about following scenario:

- client connects to server and retrieves records
- server goes down and then goes up with a new data file and a new set of records
- client modifies a record

Is this problem solved somehow in RMI?
If not, do you care about it?

Tom
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That scenario would likely cause the RMI stubs to loose their validity at the server, and thus a RemoteException (but test it, I've not done so).
Even if not, my implementation would catch it as it checks the record it locks for changes from the initial state it read before the user modified it, and only commits changes to the database if those states are identical.
If they aren't, the modifications are shown to the user and he is asked to confirm that the changes are indeed to be committed to the database.
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such failure scenarios are not in the scope of the assignment. I wouldn't worry about it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic