• 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

Beta Question: unlock

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the method defined in the DBAccess interface:

So what happens if the cookie passed in does not match the cookie of the locked record? Shouldn't this method also throw RecordLockedException? Right now I just do nothing if that's the case. What do you think?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
long cookie?
Where did you get that, in my interface it is just unlock(int record)
Mark
 
Tybon Wu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting... I guess we get different versions fo the project. In my instructions it says "Version bfkq"
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have version aejb and the signature of the unlock method is like yours. I guess you are right, a RecordLockedException should be thrown in the case the record is locked but the cookie does not match...I'm not sure whether I am going to change the interface or do something else... I'll keep you posted...
And shouldn't the update (and delete) method throw RecordNotLockedException if an update is attempted without first locking it? Or should we automatically lock the record if the latter is unlocked when invoking update (or delete) and then automatically unlock it when the update (or delete) method has been performed?
[ September 06, 2002: Message edited by: Valentin Crettaz ]
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have Version bfkq
and here is the interface I got.

What I found weird in the following text is

The exceptions used in this interface must all be created as member classes of the suncertify.data package


suncertify.data, yet the interface is suncertify.db. Is there something wrong here?
Mark
[ September 06, 2002: Message edited by: Mark Spritzler ]
 
Tybon Wu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my interface. Notice it's called DBAccess.

My interface requires a matching lock cookie to write or unlock the record. Looks like your interface has more freedom in terms of how the access control is implemented. I also have to create the exceptions in the suncertify.data package. I just did what it says and import the exceptions I need.
 
reply
    Bookmark Topic Watch Topic
  • New Topic