HHH-13916 / WFLY-13259
by Gail Badner
I've been looking into how to fix this issue:
https://hibernate.atlassian.net/browse/HHH-13916
https://issues.redhat.com/browse/WFLY-13259
The crux of the matter is when Hibernate calls CacheHelper.fromSharedCache(
session, cacheKey, cachAccess ), and the entity is not found in the cache,
Infinispan stores a PendingPut containing a
SharedSessionContractImplementor instance.
IIUC, as an optimization, Infinispan assumes that the entity not found in
the cache will ultimately be added to the cache after it is loaded from the
database. If that doesn't happen, the PendingPut will expire and will
eventually be removed. Until it expires,
the SharedSessionContractImplementor instance cannot be garbage-collected.
This is particularly a problem if the cache is not disabled while a large
amount of cacheable data is being imported. This is the particular use case
described by WFLY-13259. There is a reproducer attached that
throws OutOfMemoryError.
The obvious workaround is to set org.hibernate.CacheMode.IGNORE (or
possibly CacheMode.PUT?) while importing data.
I discussed this briefly with Sanne, and we agree that an improvement would
be to not store a SharedSessionContractImplementor in a PendingPut at all.
There is already a way to get a UUID for the session by calling
SharedSessionContractImplementor#getSessionIdentifier(). Unfortunately, the
implementation in AbstractSharedSessionContract indicates that frequent
"UUID generations will cause a significant amount of contention".
Sanne has suggested returning a "token" that is just a new Object. I've
created a branch
<https://github.com/gbadner/hibernate-core/tree/HHH-13916_token> [1] that
does this.
Infinispan would need to be updated so that PendingPut#owner is set
to SharedSessionContractImplementor#getSessionToken() (instead of
the SharedSessionContractImplementor object).
Looking at the Infinispan code, I see that code that would be affected is
in
org.infinispan.hibernate.cache.commons.access.PutFromLoadValidator, which
is used by infinispan-hibernate-cache-v51.
IIUC, in order to fix this any time soon for WildFly or EAP 7.x, [1] would
have to be backported to both Hibernate ORM 5.1 and 5.3 branches, and the
Hibernate versions would have to be updated in Infinispan before Infinispan
could be updated to use SharedSessionContractImplementor#getSessionToken().
Galder/Radim, are there any plans for
dropping infinispan-hibernate-cache-v51?
Are there other places where the SharedSessionContractImplementor is stored
in the cache?
Aside from infinispan-hibernate-cache-v51, do you see anything about [1]
that would cause problems?
If not, when do you think we could coordinate this change? Do we need to
wait for Hibernate ORM 6.0?
This is considered an improvement, so it's not urgent. It would be nice to
fix this though.
Galder/Radim, please provide your input so we figure out when it can be
fixed.
Thanks,
Gail
[1] https://github.com/gbadner/hibernate-core/tree/HHH-13916_token
[2]
5 years, 7 months
Branching 5.4, master is now 5.5
by Sanne Grinovero
Hi all,
I've branched the current master, which was updated now to build
version 5.5.0-SNAPSHOT.
In parallel, we've created a 5.4 branch.
Please merge any new enhancements and bugfixes in master first; then
we can take backports in consideration as usual.
But also: we'd expect most enhancements to rather target the quickly
evolving branch for ORM 6: wip/6.0 - the main purpose for the 5.5
branch is to deliver some of the simpler enhancements, such as JPA 3,
but the focus for most new cool things is definitely the ORM 6 branch.
Thanks,
Sanne
5 years, 7 months
please close HHH-13939
by Jason Pyeron
It was a failure of finding the documentation between 4.x and 5.x with regards to @GeneratedValue(AUTO) behavior.
Setting hibernate.id.new_generator_mappings=false fixed it.
v/r,
Jason
5 years, 7 months
Hibernate Search 6.0.0.Beta6 released
by Yoann Rodiere
Hello,
We just published Hibernate Search 6.0.0.Beta6.
Aside from several bugfixes, this release mainly introduces schema
management configuration and API at the mapper level, sorts on multi-valued
fields, simpler and configurable indexing queues, implicit nested
predicates, and offline startup for Elasticsearch.
It also includes upgrades to Lucene 8.5, Elasticsearch 7.6.1 and Hibernate
ORM 5.4.13.Final.
For more information, see our blog:
https://in.relation.to/2020/04/01/hibernate-search-6-0-0-Beta6/
Yoann Rodière
Hibernate Team
yoann(a)hibernate.org
5 years, 7 months