I'm using the following code to initialize my Hibernate Search index:
EntityManager em = ...
FullTextEntityManager fullTextEM = Search.getFullTextEntityManager(em);
Now when I execute this code, I'm getting the following exception:
o.h.s.e.i.LogErrorHandler - HSEARCH000058: HSEARCH000116: Unexpected error during MassIndexer operation
org.hibernate.TransientObjectException: cannot lock an unsaved transient instance: com.example.Foo
In this case, the com.example.Foo
class does have a @Transient
annotation for a field that is calculated, but I don't want to be stored. This class is also not
annotated with @Indexed
. Note that this error is only cropping up when I try to create the index. Using the code otherwise works properly.
I've even tried removing all my @Field
annotations and only have a single class marked with the @Indexed
annotation, but I still get the same exception. Can anyone offer any advice?