HSEARCH-1270 : indexing (still) happening after Session#clear()
by Sanne Grinovero
I'm having a half-baked solution for HSEARCH-1270, and it looks like I
can't do better than that without waiting for HHH-8577 to be included
in ORM [JIRA links at the bottom].
# The problem described by HSEARCH-1270
After the user has enqueued some indexing operations in Hibernate
Search's Worker, if he then invokes Session.clear() the queue is not
cleared.
I realize that clear() might not be as popular as most other methods
on Session, still I consider this an annoying limitation: it
introduces an inconsistency in the index and the user might not even
realize the mistake, and neither do we have an opportunity to warn
him.
# Partial solution
This is working well, and the test passes:
https://github.com/Sanne/hibernate-search/compare/HSEARCH-1270?expand=1
#Why it's not complete
The test requires to invoke the clear() operation *after* having
wrapped the Session in a FullTextSession.
In other words, if I'm just using the Session the bug would still manifest.
#What now
Considering that we can't do better than that - at least without
patching ORM with HHH-8577 - would you still merge such a patch?
I would propose to merge it, and add a warning in the docs, at least
the user has an option to workaround the issue.
The downside is that so far, at least Session and FullTextSession
behave consistently.. was that a good thing?
Another approach to the problem could be to provide an explicit
FullTextSession#clearIndexingQueue()
I think I'd like that, especially as it can be useful in other
situations, for example to avoid triggering any indexing operation for
a specific transaction.
Also, it would be a good companion for
FullTextSession#flushToIndexes()
-- Sanne
https://hibernate.atlassian.net/browse/HSEARCH-1270
https://hibernate.atlassian.net/browse/HHH-8577
11 years, 2 months
LoadPlans, EntityGraphs, 4.3 and moving forward
by Steve Ebersole
At this point I think we are far enough along with LoadPlans and
EntityGraph work to move that over to upstream master. Given that the
rest of the 2.1 TCK is in good shape I'd like to do that as soon as
possible. So I'd like to plan out how/when to get this moved over from
my fork to upstream. I have no problem doing the actual move if y'all
would prefer, we all just need to agree on a time to do it.
At that point we also need to start breaking down the remaining work
into granular chunks so all of us can pitch in and get 4.3 rolling.
Gail, Strong, since y'all have been working on this lately can y'all
give some thought to this and start breaking it down into tasks/chunks?
11 years, 2 months
[OGM] Staxmapper dependency in OGM distribution
by Davide D'Alto
Hi,
I've noticed that the staxmapper-1.1.0.Final.jar is included in the
distribution package in this folders:
infinispan, ehcache, required, mongodb
I checked and it is seems a dependency of infinispan (and arquillian
actually) but I don't understand how come is included in all the folders.
Am I missing something?
11 years, 3 months
javax.persistence.Query#setLockMode and native (SQL) queries
by Steve Ebersole
The spec specifically says that javax.persistence.Query#setLockMode
should throw an IllesgalStateException when called on a query that
represents a native query. Our implementation has not done that
historically since we do have (to varying degrees) the ability to apply
locking to the SQL.
However the 2.1 TCK is checking this and we are failing because we do
not throw the IllesgalStateException :(
So I changed up our impl to throw the IllesgalStateException to pass the
TCK. I did add a new query hint to allow users who might be relying on
this to keep on trucking. So instead of:
Query q = em.createNative( query );
// this is what is illegal
q.setLockMode( theLockMode );
users would need to do:
Query q = em.createNative( query );
q.setHint( QueryHints.NATIVE_LOCKMODE, theLockMode );
Just an FYI...
11 years, 3 months