• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about multiple remote clients changing db

 
Ramses Tutoli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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.
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic