最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Using UPDATE queries in JPA - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论