|
Hi Shay,
1. yes you're right, that is a completely pointless HashSet!! 2. Good point - I will try and create a test case for it and if I can find the same probem with insert also then that answers the question I tried to create the same failure for inserts...
I had to alter the domain model slightly to add one more level of depth between the object I was inserting and the collection I expected the exception to occur for, according to my understanding of the problem. What happened was that the exception is NOT thrown. I debugged and found that even though at the end of Compass's HibernateEventListener#onPostInsert there have been additional CollectionEntrys created - presumably due the the indexing process - they do not raise the error, even though they have processed=false. Something in Hibernate sets the processed flag to true later on and everything is fine. So AFAICT the same code logic is not required for postInsert. According to http://forum.compass-project.org/thread.jspa?messageID=296707
I just came across this issue, too. Strangely enough, it only seems to occur after switching the project from a standalone Spring container to a JBoss-based project. There's some discussion on the Hibernate bugtracker (issues HHH-1725 and HHH-2763 mainly) and it seems like other libraries (like Hibernate Search) suffer from the same problem.
|
||||||||||||||||||||||||||||||||||||||||||
Thanks for the effort!. I took a look at the changes you posted, and I think its a great way to solve this. Two questions before I commit:
1. In the finally clause, there is a HashSet that is created there. I don't think it is really needed, right?
2. Should the same logic exists within postInsert as well?