AssertionFailure: Exception releasing cache locks upon After/BeforeTransactionCompletionProcess failure

Description

When a After/BeforeTransactionCompletionProcess fails, we get a stack trace looking like this:

This happens in particular when an exception is thrown upon indexing in Hibernate Search.

I think there are two problems with this behavior:

  1. org.hibernate.AssertionFailure is supposed to indicate "a possible bug in Hibernate". There's nothing here that indicates a bug. In fact, in the case of Hibernate Search, this could simply happen if the connection to Elasticsearch breaks suddenly.

  2. "Exception releasing cache locks" seems related to a specific use of After/BeforeTransactionCompletionProcess.

I think we should rather use a HibernateException with a more generic message, such as "Exception after transaction completion: <message of the exception>"

Activity

Show:
Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created October 14, 2019 at 4:41 PM
Updated October 21, 2019 at 2:34 PM
Resolved October 17, 2019 at 1:54 PM