• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

An interesting problem

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lev,
What you are attempting to do is not part of the requirements. I wouldn't worry about it.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic