[hibernate-commits] [hibernate/hibernate-orm] 4b037c: HHH-13792 evict entity cache after transaction has...

dohertyfjatl noreply at github.com
Wed Feb 5 09:47:17 EST 2020


  Branch: refs/heads/master
  Home:   https://github.com/hibernate/hibernate-orm
  Commit: 4b037cdf8f781c8b5cbe1dcac21a2359ea339508
      https://github.com/hibernate/hibernate-orm/commit/4b037cdf8f781c8b5cbe1dcac21a2359ea339508
  Author: Frank Doherty <fdoherty at atlassian.com>
  Date:   2020-02-05 (Wed, 05 Feb 2020)

  Changed paths:
    M hibernate-core/src/main/java/org/hibernate/cache/spi/support/AbstractReadWriteAccess.java
    M hibernate-core/src/main/java/org/hibernate/cache/spi/support/EntityReadWriteAccess.java
    A hibernate-core/src/test/java/org/hibernate/cache/spi/ReadWriteCacheTest.java

  Log Message:
  -----------
  HHH-13792 evict entity cache after transaction has committed for read-write cache access strategy

- changed EntityReadWriteAccess to remove the no-op unlockRegion method (now uses the method inherited from
  AbstractCachedDomainDataAccess, which calls evictAll)

- changed AbstractReadWriteAccess to add a no-op removeAll method (as this is called by the constructor in
  BulkOperationCleanupAction.EntityCleanup, during the transaction)

- added new file ReadWriteCacheTest with some test scenarios:
  - testDeleteHQL/testDeleteNativeQuery/testUpdateHQL/testUpdateNativeQuery which confirm that the fix corrects the
    scenario where stale entities could be loaded into the cache and remain there (because the eviction was
    happening before the transaction had committed)
  - testDelete/testUpdate show that entity updates/deletions were not affected by this issue (only HQL/native queries)




More information about the hibernate-commits mailing list