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

Data class questions

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two short questions on implementing some of the DBAccess methods in a Data class.
1. For the lock cookie, is a long number based on the record number Ok to use, i.e. 1002 for a lock cookie on record 2. I am assuming here that only one Data class instance will hold a record number / lock cookie combination at any one time. Or alternatively is a random generated number a safer bet.

2. In the description of deleteRecord, it states to make the record number available for reuse (set flag at start of record to 0xFF), and also make the associated disk storage available. With second point I am thinking of calling updateRecord and setting all fields following the flag to spaces, but would this release the associated disk storage space for reuse, or just update the record to all spaces.
More a question on define "release the associated disk storage space"
Hugh
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hugh,
1. Random.nextLong() is better.
2. "making the record number and associate disk storage available for reuse" means that the space (and record number) of the "deleted" record if eligible for reuse by a next call to createRecord(). You don't need to fill in the record with blanks, IMO.
Best,
Phil.
[ July 31, 2003: Message edited by: Philippe Maquet ]
 
Hugh Johns
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Philippe
Thank you for you help
Hugh
 
reply
    Bookmark Topic Watch Topic
  • New Topic