What you essentially ask is the ability to have different locking strategies across a single hierarchy. Mixing pessimistic strategy and optimistic strategy.
You both seem to think that I want to mix pessimistic and optimistic locking strategies and I'm not sure I made myself clear in the last post. No, I don't want to mix these strategies. Firstly, I don't think there's anything wrong in doing so, except that if one entity have a version attribute and the other don't, then "correct interaction with applications using optimistic locking cannot be ensured" (JPA 2.1, section 3.4).
However, instances of my A type did not use any locking strategy at all. Instances of my B type use optimistic locking.
Finally, let me give you a big thank you for taking time and by the sound of it, being professional programmers devoted to the community. I know very well how much time and effort goes into our passion and into creating and developing amazing products like Hibernate.
|