Thanks for reply, now it's clearer. Sadly, it is like Martin says. Accordingly to CDI specification, we register a synchronization for each transactional observer. This means we basically do a "delayed invocation". Beyond that point, we cannot guarantee the ordering as it is dependent on how JTA processes the transaction and when it notifies observer methods linked to respective tx stages. You may need to revisit the architecture of your application not to depend on the ordering here. Or perhaps implement additional synchronization in code to make sure createEvent is fired only after all observers for lockEvent were notified? |