Hi,
Thanks for accepting my feedback so graciously.
Now that I understand the situation, I agree that an error or even a debug message is not appropriate. The behavior makes sense to me now :)
Although I think it's best to make API's self-describing, in this case, it's probably a documentation issue.
The thing is... it never occurred to me that manually indexing all the objects in my database should involve transactions. But, now that it's pointed out, it makes sense. The fact that indexing is not part of the EntityManager API threw me off, I suppose.
Here's the current javadoc for index():
Force the (re)indexing of a given managed object. Indexation is batched per transaction
Here's my new understanding of how index() works:
Initiate the (re)indexing of a given managed object. If a transaction is active, the indexing work will be performed when the transaction is committed. Otherwise, the indexing work will be performed immediately.
Perhaps just updating the javadoc to something like that would help.
One thing I just noticed also, about this example:
http://www.hibernate.org/hib_docs/searc ... le/#d0e253
The JPA example does not show the use of a transaction, although the Hibernate version does. I suspect I ignored the hibernate example and just looked at the JPA one.
Thanks for volunteering to work on hibernate!
Phil