I'm trying to make an UPDATE query in one of the endpoints of my application.
@Modifying(clearAutomatically = true, flushAutomatically = true)
@Query(value = """
UPDATE events
SET confirmedRequests = ?2
WHERE id = ?1
""",
nativeQuery = true
)
public void updateConfirmedRequests(Long eventId, Long confirmedRequests);
But this update takes a very long time, because the next query pulls data without updating. But I can definitely see through DBeaver that everything is updated. What should I do to prevent other queries from processing until the update arrives? Modifying and Transaction do not work.