Evict during concurrent update and putFromLoad can result in stale entry in 2LC
PutFromLoads in replicated/distributed caches should propagate asynchronously
It would require additional effort to isolate only changes that fix
HHH-11323 and which just allow async propagation.
(cherry picked from commit 160f5ba863)
* always use global transaction id (in transactional caches) or command invocation id (in non-transactional caches) to identifiy the invalidator
* don't use afterInvoke/afterUpdate/unlockItem to end invalidation as this is not called during rollback
** use Infinispan transaction handling or explicitly registered invalidation to hook into the process
** move invalidation calls to interceptor stack where we have the identifiers
* don't use deprecated methods for commands marshalling
(cherry picked from commit 294ba74c76)
Conflicts:
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/access/InvalidationCacheAccessDelegate.java
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/access/NonTxInvalidationCacheAccessDelegate.java
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/access/NonTxPutFromLoadInterceptor.java
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/access/PutFromLoadValidator.java
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/access/TxInvalidationCacheAccessDelegate.java
hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/EndInvalidationCommand.java
hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/InvalidationTest.java
* DefaultCacheKeysFactory implements CacheKeysFactory, therefore it can be used in hibernate.cache.keys_factory
* Use DefaultCacheKeysFactory by default
* Add "default" and "simple" as short names for those factories
* AccessType.READ_WRITE is now supported cache concurrency strategy
* Added checks that we're caching in local or invalidation cache (distributed and replicated cache does not work ATM)
* Refactored test-suite: Running on both transactional and read-write caches (these should yield the same results)
** CustomParemeterized runner is used for that
** Moved all entities used in functional tests to one package
** Removed already disabled tests related to class loaders (not needed since Infinispan 5.1)
* ISPN-5609 changed InvalidateCommand constructors: used reflection to work around that; now should work with 8.0.0.CR1
* renamed BeginInvalidationCommand.getLockOwner to getSessionTransactionId() to prevent further conflicts
* added commands tests
* The write can only invalidate (remove) the entry and block further PFERs of that entry
* After successful DB update, if there have not been any concurrent updates the value can be PFERed into the cache
* Also removed put() instead of PFER() after region invalidation
* Relaxed test that required that session.load() after cache.evictAll() in the same transaction cached the loaded entity
* invalidation blocks putFromLoads until the transaction with invalidation
is committed
* rewritten the naked puts support: timestamp is stored in the pendingPutMap
and removal of the record relies on pending puts' idle expiration or
piggy-backs on release from putFromLoad