• 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

lockCookie

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a bit confused here...Do I understand it correctly that when a record is locked, and a lockCookie is created for that specific Reservation object, that a new Reservation object is itself instantiated at that time (or just before)as well? The Reservation object then pulls the data that does not change from the database (like Smoking N), and takes on the data (like client Id) that is given to from the client side. Does this sound okay? That is the path I am getting ready to take but I just wanted to get some feedback before I travel down that road.

Thanks to everyone!
Matt
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Matt!

Do I understand it correctly that when a record is locked, and a lockCookie is created for that specific Reservation object, that a new Reservation object is itself instantiated at that time (or just before)as well?



Hum... no. You don't have to instantiate it. In order to control the locked records and their corresponding owners, you can have a Map<Long, Long> in your Data class, where the key is the record number and the value is the cookie value. When a record is locked, you can just put this information in this map. Something like this:

 
Matt Pavlovich
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roberto,

Thanks very much...it is now ridiculously clear how simple that solution is. I have been sitting here too long. Time to give the brain a rest.

Thanks again.
Matt
 
Roberto Perillo
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright, partner. Now, please, go take a nap!

But don't give yourself a hard time. I know exactly how you feel. It's just that some of the requirements may be hard to understand. But, that's why we're here!
 
reply
    Bookmark Topic Watch Topic
  • New Topic