Spring Cache integration
by Steve Ebersole
Someone just opened a PR to add support for Spring Cache as a second-level
cache provider[1]. They implemented this by adding a new Hibernate module
`hibernate-spring-cache` that essentially wraps Spring Cache as a JCache
(apparently Spring Cache does not implement the JCache contracts).
Part of the hope with hibernate-jcache was to get out of the business of us
maintaining these individual cache integrations.
Anyone have strong opinions here?
[1] https://github.com/hibernate/hibernate-orm/pull/1639
8 years, 1 month
Correlating Java 1.8 Streams and ScrollableResults with database cursors
by Vlad Mihalcea
Hi,
I've noticed this new Jira ticket:
https://hibernate.atlassian.net/browse/HHH-11260
and I think we should correlate the Session#stream and Session#scroll with
database cursors.
While Oracle uses a fetch size of 10, and SQL Server uses an adaptive
cursor, PostgreSQL and MySQL just fetch the whole result set into the
client.
So, for MySQL we could do as suggested in the Jira ticket, by setting the
fetch size to Integer.MIN_VALUE.
My question is about PotgreSQL. Postgres requires setting the fetch size to
some positive value in order to turn the current statement into a database
cursor.
Now, should we set a default value for streaming (e.g. 10), which can be
controlled via a new config property:
hibernate.jdbc.stream.fetch_size
Let me know what you think.
Vlad
8 years, 1 month
SQM - subqueries and order-by
by Steve Ebersole
SQL 92, 93 and 99 (i have not checked 2003) all limit order-by to only be
allowable in the root query.
Unfortunately the current HQL grammar allows subqueries to be ordered. So
I wanted to start a discussion of whether we want to support this as we
transition to SQM and 6.0. The real problem with supporting ordering of a
subquery is that neither HQL nor JPQL support pagination of a subquery
which is honestly the only time that ordering the subquery makes any sense.
So IMO we have 2 choices:
1. Add a new pagination syntax to the HQL language and continue to allow
ordering of subqueries
2. drop support for ordering subqueries.
Thoughts?
8 years, 1 month
Change in DB lock acquisition in ORM?
by Radim Vansa
Hi,
I am investigating the failures in hibernate-infinispan testsuite and
I've found that [1] is failing as this uses two threads that both do
1. load entity
2. delete entity
3. flush session
4. commit tx
on the same entity. There is a synchronization blocking the commit until
both threads flush, and since the first thread holds a H2 DB lock on the
entity, the other thread is blocked doing the flush on this lock.
It makes sense to me, but I wonder why did the test work in the past.
Was there a change in some locking defaults (optimistic/pessimistic) or
was there anything delegating the lock acquisition to the commit instead
of flush? The test works on 5.0.10.
Radim
[1]
https://github.com/hibernate/hibernate-orm/blob/master/hibernate-infinisp...
--
Radim Vansa <rvansa(a)redhat.com>
JBoss Performance Team
8 years, 1 month
FW: DirectPropertyAccessor replacement in hibernate 5.2.4
by Vikas Bali
Hi
I used to extend DirectPropertyAccessor and had custom implementation of getter and setter implementation of the hibernate property. Could you please let me know what should I replace it with. I tried replacing it with PropertyAccessStrategyBasicImpl and PropertyAccessStrategyFieldImpl but I keep getting error of missing field on the properties defined in my hbm file and it used to work fine with hibernate 4.1.6.Final.
Please suggest.
Thanks
Vikas
8 years, 1 month
[OGM] Inheritance mapping in Neo4j
by Davide D'Alto
A user created the issue https://hibernate.atlassian.net/browse/OGM-1210
The problem is that when we use the SingleTable strategy in Neo4j we
add a property DTYPE to the node to discriminate the entities instead
of using labels.
As an example, given an entity Player that extends Person we create:
(n:Person {DTYPE: Player})
instead of having a node with two labels:
(n:Person:Player)
I think the mapping with multiple labels is more natural than the one
we currently have.
I was wondering if we should fix this for the next release, the
problem is that I would need additional information in one of our
.spi.*Context and it will change the mapping.
The next release should be 5.1.Beta2
What do you think?
Thanks,
Davide
8 years, 1 month