What is exact purpose of flush in JPA

前端 未结 2 404

Some confusing explanation: flush(); Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory.it will update or insert into

2条回答
  •  孤街浪徒
    2021-02-02 18:00

    When the transaction commits the entity manager does that flush-ing for you. In some case, like handling optimistic locking in a container-managed transaction, you may need to manually invoke the flush method to catch and handle specific locking exception.

提交回复
热议问题