• Post Reply Bookmark Topic Watch Topic
  • New Topic

B&S: Locking strategy question  RSS feed

Xabier Martija
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

I have the B&S 2.1.3. assigment that uses locking with cookies.

I liked Marcelo's solution Locking strategy with singleton because it was easy to understand and simple. This aproach was also what i had in mind before reading the Denny's DVDs example.
I was implementing a solution similar to yours but i found a good reason not to do so.

The specifications of my lock method:
Locks a record so that it can only be updated or deleted by this client.
If the specified record is already locked by a different
... waits until the record is unlocked.

the expresions "by this client" instead of "the client who owns the cookie" , or "by a different client" instead of "with a different cookie" is confusing for me.
It seems that they whant a solution similar to Denny's DVDs in witch the "client" is passed by parameter by the DvdDatabase class.

If that's what they expect us to implement i don't understand the sense of using a cookie.

If the client must indentify itself for locking , what's the sense of obteinning a random generated coockie if we also need to store the identity of the client that locked the record?

That's because i think it's also posible to understand and replace "the client who owns the cookie"
and "with a different cookie" instead "the client" and "different client" in the specifications.

would this interpretation end in a Automatic Failure ?

does anyone know someone passed this way?

Do you have similar specifications for locking ?

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!