| It seems your problem happens during `PostTransactionWorkQueueSynchronization.beforeCompletion`, which means proxies should still have a session. Except... if you used entities from another session, or serialized/deserialized entities, without first attaching them explicitly to the new session. If you did that, then it's not a bug in Hibernate Search, it's just a bug in either Hibernate ORM or in your application: Hibernate Search cannot possibly detect that an entity comes from another session and decide to re-attach it to the new session for you. Even Hibernate ORM does not! I'd recommend checking where that particular entity comes from and ensuring it is correctly attached to the session before it is added to your main (indexed) entity. If that solves the issue, then we can close this ticket. See the section about working with detached data in the Hibernate ORM documentation. |