• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An interesting problem

 
lev grevnin
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey all,
Suppose i run my FBN client (client A) in local mode. It attaches to a local db.db and tries to make bookings. Suppose another FBN client, client B (running in a different JVM, but on the same computer) attaches to the same db.db file and starts making bookings. I see a conflict here:
1. Client A grabs a record and determines it can deduct a certain number of seats from the booking.
2. Client B grabs a record and determines it can deduct a certain number of seats from the booking.
3. Client B deducts the seats and writes the updated record back to db.db.
4. Client A deducts the seats and writes the updated record back to db.db.
This, of course will produce an incorrect number of seats on the database in that particular record (i hope you all see why).
My question is this:
I understand why we need locking records between clients in remote mode - to prevent the situation i just described. But how can this situation be prevented in the case FBN clients (or in a more general case - unrelated programs) attempt to modify database? How can locking be done in this case?
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lev,
What you are attempting to do is not part of the requirements. I wouldn't worry about it.
 
Rahel Luethy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i agree with sai -- this is not part of the specs.
actually, the same happens in remote mode when you start two servers using the same db file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic