This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S long recordnumber dilemma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S long recordnumber dilemma" Watch "B&S long recordnumber dilemma" New topic
Author

B&S long recordnumber dilemma

Kah Tang
Ranch Hand

Joined: Sep 10, 2007
Posts: 58
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 ]
Soroj Margun
Ranch Hand

Joined: Jun 15, 2008
Posts: 44
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.


SCJP 1.2; SCWCD 1.2,1.4; SCBCD 1.3; SCJD 5.0
Kah Tang
Ranch Hand

Joined: Sep 10, 2007
Posts: 58
Thanks.. That's exactly what I needed to know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S long recordnumber dilemma
 
Similar Threads
Bodgitt and Scarper 2.2.1: Caching
Adding and Deleting Records
URLyBird 1.3.1 DB Access layer design, pls comment!
locking and the find method.
B&S: What is the Value used for RecNo