Having Item is an entity which contains List of Boms as association, when item is being updated then order of boms updates need to updated based on primary key to prevent the database deadlock if same item entity is being updated from other session.
problem solution reference here
As per above link hibernate.order_updates
then associated entities will update in primary key order such a way we can prevent concurrent updates and this is fine.
But after adding hibernate.order_updates
property to true, main Item entity is updated after associated bom entities updated, need to update Item entity is first and then associated bom entities to prevent the item level concurrency.
How to do this, is there any configuration in hibernate. Please suggest how to move forward.
Currently we are in Spring4 and hibernate 4.