PostCommitSynchronousRunner creates a thread for each listener. This is also true for its derived class BulkExecutor (used only for bulk import).
Instead it should reuse the threads. Somehow.
Note that HibernateConfiguration.createEntityManagerFactory has the same use case.
One idea would be to associate a delegated thread to the main thread, and reuse it when needed.
- is related to
-
NXP-27986 Deprecate post commit event listener execution
- Open