Waiting on lock <0x754d0045> (a org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader)

Look, I understand that this isn’t ideal, and we fixed that in Hibernate 6, but you usually don’t run into this unless you are creating a ton of “unique” queries that trash the query plan cache. So IMO you should size the query plan cache accordingly.