Originally posted by Titus Barik:
Basically, if no one has locked it, anyone can do whatever they want. If someone has locked it, then other clients must wait on that record until the locker unlocks it for update and delete options. Anyone can read, regardless of whether the record is locked or unlocked.
scja|scjp|scjd|scwcd|scbcd|scdjws|scmad
Originally posted by Titus Barik:
Is this behavior okay for locking? Basically, if no one has locked it, anyone can do whatever they want. If someone has locked it, then other clients must wait on that record until the locker unlocks it for update and delete options. Anyone can read, regardless of whether the record is locked or unlocked.
SCJP 1.4, SCJD
Originally posted by Frans Janssen:
This seems to be not the way it is intended. The mere prensence of the lock method seems to me to suggest that you need to lock any record that must be updated or deleted.
OTOH, the instructions don't seem to contradict your locking behavior, but I would not gamble on outsmarting the exam developers.
Originally posted by Titus Barik:
is just silly. update is ALREADY atomic. Two things can't update the same record simultaneously anyway because of the lower-level synchronization on the raf, so there's no point in doing a lock around the single atomic update instruction.
scja|scjp|scjd|scwcd|scbcd|scdjws|scmad
Originally posted by Titus Barik:
update is ALREADY atomic. Two things can't update the same record simultaneously anyway because of the lower-level synchronization on the raf, so there's no point in doing a lock around the single atomic update instruction.
SCJP 1.4, SCJD
Originally posted by Uwe Sch�fer:
i think, there is. synchronization (via language) is not enforceable by the interface contract. so the atomicity of update(...) may be considered implementation detail of the lower-level data-access layer.
so explicit (higher level) locking in the business layer that is usable for simple operations as well as complex (multi-method-call) ones is not that pointless.
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|