Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

question about multiple remote clients changing db

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's say you have multiple GUI clients accessing our server db. If one client books a customer, should all the other GUIs be updated automatically to reflect this change? How would this be accomplished?
My program right now doesn't do this. Updated info isn't shown unless the client re-queries the db with a search or something.
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ramses,

If one client books a customer, should all the other GUIs be updated automatically to reflect this change?



No, they shouldn't.
Let's take an example:
Client 1. reads records
Client 2. reads records
Client 1. books record #3
Client 2. attempts to book record #3 and sees that now the record is aleady booked. It shows just a message to client to refresh his search results.
To do it, you should do following:
lock the record
read the record and check if it hasn't been and changed and hasn't been booked
if everything is ok book if not throw Exception
unlock record.
Best,
Vlad
 
reply
    Bookmark Topic Watch Topic
  • New Topic