• 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

NX: Am I the only one who MUST use lockCookie?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm doing URLyBird 1.2.1 and did the locking mechanism as many others: I use the unique Data-object as lock. But when i scanned the instructions for all "musts", I stumbled upon this comment inside the DBAccess interface which I must implement:
// Returned value is a cookie that must be used when the record is unlocked,
// updated, or deleted.
How strict is this "must"? It's not stated in the "What you must do"-chapter. And how come I seem to be the only one that must use the cookie for unlocking?
Maybe it's enought to do an add-on to my locking mechanism by storing a lockCookie in my Data-object and verify the cookie? Seems like an unnecessary double-check. Any ideas?
Cheers,
Sakke
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How strict is this "must"? It's not stated in the "What you must do"-chapter.


You will result automatically fail, if you have not implemented ALL MUST items.


And how come I seem to be the only one that must use the cookie for unlocking?


You can assign a cookie, like transaction ID, to each transaction, and thus, the cookie in fact can be used to identify the transaction, and you can use it to identify the whether an object is lock by which transaction.


Maybe it's enought to do an add-on to my locking mechanism by storing a lockCookie in my Data-object and verify the cookie? Seems like an unnecessary double-check. Any ideas?


This depends on how you implement your locking mechanism. But you always need to check whether the object has been locked, and then accquire a lock if it is available or wait for a lock to be available.
Nick
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic