Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of seek()

 
luis veron
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
Guys, can you explain what will happen if for example there were 2 users trying to search for a flight with different search criteria. If pc A tries to search and within the criteriafind method, we use the method seek(50), and another guy tries to search also and try to seek(100), this would be an issue since the db file position would be inconsistent. I think the reason why the Data class was declared synchronized is because to prevent this kind of inconsistency.
But if we continue to use the synchronized seek() method, the idea of concurrent reading of each record would be useless..
Come to think of it, If I'm going to read through the whole db to find the matching search criteria, anyone who try to search will need to wait after I finished using my criteriaFind() method. I think the filepointer is an issue here?
Any other idea about this.

Thank you very much
Luis
[This message has been edited by luis veron (edited March 20, 2001).]
 
luis veron
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems no one is interested in giving ANY answer/clarification to my inquiry..been waiting for reply ever since I posted this topic.
Nevertheless, Thanks for your support.
[This message has been edited by luis veron (edited March 22, 2001).]
 
Aron J. Skantz
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luis,
Personally I havn't replied since I don't understand what the question is and was kinda hoping that someone else would be more intelligent and respond

\Aron
 
Sam Wong
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luis,
Your points are quite correct. The synchronized methods will not be efficient. In the real world, would you use a file pointer? No. A database server is the most likely choice. But for the purposes of this exam, it isn't available. Hence, synchronized access will have to do. So, don't sweat over it.
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic