• Post Reply Bookmark Topic Watch Topic
  • New Topic

NX: contractors search problem  RSS feed

Gytis Jakutonis
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure hwo should I handle search, since search involves two DBMain(Data) methods - find() which returns int[] and read() which returns String[]. Suppose we have the following implementation:

Problem: records may be changed or event deleted between find() and read() calls. Solutions:
  • skip deleted record(catch RecordNotFoundException), also validate record data after read and skip non-matching ones - quite reasonable since we need to check each record after read() anyway to get only excact matches, but some records may be missing
  • lock database before find and unlock after all reads are completed - ensures that all matching records are collected, but may cause performance downgrade with many clients and many records

  • Any comments? Thanks.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!