I am a toplink user and as you may know one of the features of toplink is it accesses a collection of entities always in a same way (for example when saving updated entities to database it starts saving the entity with lowest primary key and goes on in an ascending manner). This prevents many potential deadlock situation when concurrent users run the same usecase in separate transactions.
I've read the grate "Java Persistence with Hibernate" book carefully cover to cover, however I didn't see any evidence that Hibernate supports such feature.
I even scared particularly when I want to use CascadeType.SAVE_UPDATE to save an entity who has a collection of entities in a transaction. To be precise, if two users want to update the same collection in two transactions and each access collection entities in different order, then we will have a dead lock.
I will be highly appreciated if some one addresses my concerns.
|