Byteman and errorhandling
by Sanne Grinovero
Hello,
In the quest to write a proper unit test for HSEARCH-625 this night
I've introduced Byteman
in the testsuite of Hibernate Search.
I must say I'm impressed and love the tool, the fix is ready and the
test rocks, it empowered me to
write code with confidence to catch the IOException errors in Lucene's
MergeThread which would
have been tricky to write, hard to test without it.
Shall we keep it, and promote my experiment to a pull request (needing
some docs yet) ?
Sanne
14 years
Git pull workflow and Jira
by Scheper, Erik-Berndt
Hi,
Yesterday, I've been looking into HHH-5750 and I found it very convenient that I could look back in Git and find that the original code was introduced for issue HHH-3871 and later modified for issue HHH-4791.
This gave me a bit of background and actually made me doubt if the proposed fix for HHH-5750 might not actually reintroduce the original issue (I haven't figured that out yet, if anyone could help out there, that would be great!)
And after this happy experience, I'm now getting a bit worried that this connection between Jira and Git might be lost by the Git pull workflow. Let me explain this:
For example this morning I noticed that https://github.com/hibernate/hibernate-core/pull/22 has been merged into branch 3.6 which fixes HHH-5756. This merge has introduced the following commits into the 3.6 branch (again, it's not about the changes itself, but about the workflow):
Merge branch '3.6' of https://github.com/rsvato/hibernate-core into 3.6
commit 0168ffa83cc8eac88453
Moved hbm.xml -> annotations.
commit 350801542c20cfc0fd0a
Tests are slightly changed to do more work
commit e1f8b5e5f2cb107e3277
[#HHH-5756] Ignore collection changes if no revision on collection change is set
commit 3091bbda15b24a0bdf33
Test for creating revision on collection change
commit 387faed8556ca86d8ad4
Maybe I'm missing something, but I don't think I would ever link a commit such as 'Moved hbm.xml -> annotations' to jira issue HHH-5756. And I find it hard to believe that Jira or fisheye would link it the other way around. From a maintenance point of view, this looks like nightmare to me.
Now, I'm not sure what the right way would be to fix this. The easiest would probably be to squash the pull request into a single commit, but I'm open to all suggestions.
Regards,
Erik-Berndt Scheper
Disclaimer:
This message contains information that may be privileged or confidential and is the property of Sogeti Nederland B.V. or its Group members. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
14 years
HSEARCH-615 Support time-constrained queries returning the first available results
by Emmanuel Bernard
If you can find better name for the API, please advise. I am not happy with the current version
Query luceneQuery = ...;
FullTextQuery query = fullTextSession.createFullTextQuery(luceneQuery, User.class);
//define the timeout in seconds
query.limitFetchingTime(500, TimeUnit.MILLISECONDS);
List results = query.list();
if ( query.hasPartialResults() ) {
displayWarningToUser();
}
Emmanuel
14 years
TODO for CR2 or Final
by Emmanuel Bernard
I've applied Sanne's work on the work queue, yeah!
But there are remaining bugs that should ideally be addressed or analyzed for CR2. Let's see what we can do by tomorrow.
I've labelled them 3.3.0.Final but if we can fix them for CR2 even better.
HSEARCH-640 MassIndexer and Java EE
I don't think it can work today but I need Sanne's confirmation
HSEARCH-630 easy API renaming,
we should do it. Let's wait for the final baking on the hibernate-dev ML
HSEARCH-637 Documentation review (lead by Hardy)
This can be committed the minute before the Final version
HSEARCH-625 Some holes in the ErrorHandler
Would be nice to get that fixed
HSEARCH-629 NumericField as experimental
I'd rather mark it as experimental, it's cheap and we can revisit in a few months.
HSEARCH-431 More doc on MassIndexer
This can be committed the minute before the Final version or even after.
Emmanuel
14 years
Why don't session filters affect UPDATE / DELETE statements?
by Jason Clawson
I am curious as to why the decision was made to not append a WHERE clause to
deletes and updates that could be affected by a session filter. I was
looking at the source for HqlSqlWalker.postProcessDML, and it has the
comment "append any filter fragments; the EMPTY_MAP is used under the
assumption that currently enabled filters should not affect this process."
So, it seems this was a conscious choice. I would actually like filters to
affect updates and deletes and will probably modify this class to enable
this. My reasoning is that if you have a filter turned on and perform a
select then perform an update using HQL you would expect it to only modify
those things returned in the select (lets ignore the fact that this is a
race condition as I am oversimplifying). We are using session filters to
automatically restrict a logged in user's view of certain data. This works
great for selects, but obviously allows HQL updates and deletes to bypass
this restricted view.
So, my questions are, why this choice? and would you consider changing your
mind?
Thanks,
Jason
14 years
Contributing to Hibernate development
by Srinivasan Krishnan
Hi,
I have been working on hibernate and I am interested in contributing in
hibernate development. Could you please let me know the process and how to
start.
Thanks,
Srini
14 years
object is not an instance of declaring class
by Sanne Grinovero
Hello,
I'm blocked by the exception mentioned in the subject, this is also
affecting my work in Search:
with the new design I need the object identifier more often than before, and
even our own org.hibernate.search.test.proxy.ProxyTest fails.
Searching for similar exceptions I found many users asking for help
about the same error, also some
comments are quite recent so it would be nice to find a general solution:
HHH-5280
HHH-3399
HHH-1953
HHH-4064
https://forum.hibernate.org/viewtopic.php?t=979408
The error is that I'm invoking getId() via reflection, but the entity
instance is actually a javassist proxy.
Shouldn't org.hibernate.annotations.common.reflection.java.JavaXProperty
"shield" our code from this kind
of complexities?
Suggestions to proceed?
Sanne
stacktrace follows:
org.hibernate.HibernateException: Error while indexing in Hibernate
Search (before transaction completion)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:175)
at org.hibernate.engine.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:543)
at org.hibernate.engine.ActionQueue.beforeTransactionCompletion(ActionQueue.java:216)
at org.hibernate.impl.SessionImpl.beforeTransactionCompletion(SessionImpl.java:571)
at org.hibernate.jdbc.JDBCContext.beforeTransactionCompletion(JDBCContext.java:250)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:138)
at org.hibernate.search.test.proxy.ProxyTest.testProxy(ProxyTest.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.testing.junit.functional.annotations.HibernateTestCase.runTest(HibernateTestCase.java:97)
at org.hibernate.testing.junit.functional.annotations.HibernateTestCase.runBare(HibernateTestCase.java:85)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: Could not get property value
at org.hibernate.search.util.ReflectionHelper.getMemberValue(ReflectionHelper.java:94)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getIndexingId(DocumentBuilderIndexedEntity.java:699)
at org.hibernate.search.engine.WorkPlan$PerClassWork.recurseContainedIn(WorkPlan.java:136)
at org.hibernate.search.engine.WorkPlan.recurseContainedIn(WorkPlan.java:69)
at org.hibernate.search.engine.AbstractDocumentBuilder.processSingleContainedInInstance(AbstractDocumentBuilder.java:773)
at org.hibernate.search.engine.AbstractDocumentBuilder.processContainedInInstances(AbstractDocumentBuilder.java:322)
at org.hibernate.search.engine.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:268)
at org.hibernate.search.engine.WorkPlan$PerClassWork.processContainedIn(WorkPlan.java:130)
at org.hibernate.search.engine.WorkPlan.processContainedIn(WorkPlan.java:62)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:150)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:86)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:172)
... 25 more
Caused by: java.lang.IllegalArgumentException: Invoking id with wrong parameters
at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:84)
at org.hibernate.search.util.ReflectionHelper.getMemberValue(ReflectionHelper.java:91)
... 36 more
Caused by: java.lang.IllegalArgumentException: object is not an
instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:74)
... 37 more
14 years