Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

issues with search

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

Just a quick question. I realised a potential issue with searching. When a user searches for a records the system has to call find(String[] criteria) which returns a list of ids of contractors. Then in order to actually display the details of these contractors the system has to, for each contractor, call read(int recNo) which returns a String[] of the data for that contractor. The problem is if we have 10 calls to read(int recNo) and we make the first call and the server swaps us out then it is possible that although prior to your call that contractor was not booked he could get booked by the thread that swapped you out. If this happens then when the JTable is displayed for you the current state of affairs will not be represented. I doubt we need to do anything about this but it is an issue.
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mandy,

See the post of Garbriel of today, it handles the same issue. These are called "dirty reads", I think you don't need to handle that.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic