Your domain event fires. Your notification service queries the DB for the entity that just got saved. It finds nothing.

You add a log line. It starts working. You remove the log. It breaks again.

That's not a race condition. That's @EventListener.

What's actually happening

Spring's @EventListener fires synchronously, inside the calling thread, before the transaction commits. The DB row exists in Hibernate's session — but it hasn't been flushed and committed yet. Other connections, including the one your listener opens when it calls findById, can't see it.