while all the operations triggered by #afterUpdate/#unlockItem could run in parallel. If these are synchronous, running sequentially adds up a lot of latency.... Besides, if I register these synchronizations manually, I can't be sure about the order of execution
How is that any different from using JTA? I'm really not understanding what your concern about registering your sync with Hibernate's "unified sync" versus JTA directly. I just don't see how there is a real difference. Unless you specifically mean taking advantage of some JTA-vendor-specific way to order yourself in relation to specific other syncs. For example, you specifically mention parallel execution of the Session-local syncs. I also believe that would be great. Stepping back and looking at it, I wonder if most (if not all) of the "local syncs" could just be delegated to in parallel all the time. Or at least allow registering a local sync to indicate whether it should be executed in parallel. |