• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

B&S long recordnumber dilemma

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have some confusion about my assignment. It's probably something not to worry about, but I just need to get it off my chest.

The Data class that needs to implement the DBAccess interface has all methods take a long parameter for the record number. I.e. lockRecord(long), readRecord(long) etc..

Now, I've read a lot on this forum about caching and storing things like deleted records in List objects, but the problem there is that you can't call the get method with the record number, as the recNo is a long. Of course you can cast the long to an int, but what if the whole database exceeds the Integer.MAX value?

Is this something to worry about?
[ July 06, 2008: Message edited by: Kah Tang ]
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kah,

Short answer: Don't worry.

Long answer: Do not worry. There are so many reasons to ignore this, few of them are
1. Only a few OS can create database file that can contains "Integer.MAX" no. of records with specified schema.
2. You dont have to cache all deleted record in cache list. Otherwise the cache list will become array of record, right?
3. You can (and should) specified any limitation of you program in you choice document.

Nothing is perfect. The limitation is a fact to cope with.
 
Kah Tang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.. That's exactly what I needed to know.
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic