• 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

lock & unlock again!

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand this has been talked loooooooooooots of times already, but I still want to ask a couple of more regarding this.
First, do we really need to keep track of "who" locked the record when unlocking it? The spec. says

If an attempt is made to unlock a record that has not been locked by this connection, then no action is to be done.

Is "this connection" here the same as owner? How to identify the connection, then?
Second question: are we supposed to define the "record no" as in the input parameter of the methods? How? Should we virtually change the fields of the record?
Thanks a lot!
Cathy
 
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

Originally posted by Cathy Young:
First, do we really need to keep track of "who" locked the record when unlocking it? The spec. says Is "this connection" here the same as owner? How to identify the connection, then?
Second question: are we supposed to define the "record no" as in the input parameter of the methods? How? Should we virtually change the fields of the record?
Thanks a lot!
Cathy


There is always debate on these topics. First My opinion is that you must make sure that the client that calls unlock for a record has that lock to begin with. And yes this "Connection" object handles it. Search on Connection Object here and you will learn a lot. Especially look for Peter's comments on it.
2. What is the signature of lock and unlock? Isn't (int recordNumber)?
2b. I changed the data when a person booked a seat.
Mark
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


2. What is the signature of lock and unlock? Isn't (int recordNumber)?


Hi Mark, Thanks! Yes, it is the signature. But My problem is that recordNumber does not seem to be a field of the record. So are we supposed to "create" this field? Thanks!
Cathy
 
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
Npe, don't need to create that field. I believe there is a method in one of the db package classes that will give you the record number.
I need to leave a little research on your side.
Mark
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic