|
I think the JPA scpecification leaves a hint to what its authors had in mind when they designed the EXTENDED Lock scope:
This means that phantoms will be possible.
Phantom-reads are prevented by SERIALIZABLE isolation level, because range-locks are held on query result sets, and only PESSIMISTIC_WRITE can prevent phantoms. If that's the case, then all lock types should be cascaded to the link table, preventing a concurrent transaction from adding/removing Embeddables.
Although the Embeddable target table rows are not locked (because just the link table rows are), the ElementCollection doesn't actually do updates, but it removes and re-adds instead.
|