java - Using UPDATE queries in JPA - Stack Overflow

I'm trying to make an UPDATE query in one of the endpoints of my application.@Modifying(clearAuto

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745120199a4612369.html

相关推荐

  • java - Using UPDATE queries in JPA - Stack Overflow

    I'm trying to make an UPDATE query in one of the endpoints of my application.@Modifying(clearAuto

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信