Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lockCookie

 
Matt Pavlovich
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • 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
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic