• 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

Thoughts on searching

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have the B&S assignment. The interface I am given contains a search method that returns an array of record numbers that presumably match the search criteria.

The records as found by a search action are of course not locked, so when I read the records, they might have been changed by another client in the meantime and possibly do not match the search criteria anymore.

I have thought of three possible solutions:

1. just ignore this; if all that the clients can do is book a record, then at most the customer field is changed and since this is not a searchable field, it does not affect search results.

2. read in the records and do a second check to test if the read records still match the search criteria (remove records that don't from the search results).

3. read all records from the server (use search method with null search criteria) and do matching with the criteria client-side. This solution of course loads the network quite heavily, so I assume I won't please my assessor with this one. For thin client architectures this might be an option though.

Currently I am leaning towards solution 2, because that one will continue to work correctly if changes other than booking are made concurrently to the database. Do you think this solution is overkill or maybe someone found a better solution?

Thanks for your thoughts,

Frans.
 
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, I am actually leaning toward solution number one. I think that as long as you document this as a known limitation that does not affect the overall functionality of the application, you should be fine.
 
There is no "i" in denial. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic