Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locking on referenced entities

 
Cesar Koot
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While studying for JPA exam I encountered this text in the enthuware exam, handling transactions and locking:
"Entity relationships for which the locked entity contains the foreign key will also be locked, but not the state of the referenced entities (unless those entities are explicitly locked)."

What does it mean when a relationship is locked but the state of the entity isn't? Does this mean the referenced entity can't be deleted but can be updated?
 
Rafael de Sousa
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cesar Koot,

I believe it says, when a locked entity A has a collection of entity B, entity A can't add or remove any B(e.g.), but you can change any B state, like B.name or B.email (e.g. ) if B it's not explicitly locked.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic