I'm cross-posting from the Search sub-forum since I'm not sure that this is a Search-specific issue versus a likely n00b Hibernate configuration issue. A sample project that replicates this problem can be found at:
https://github.com/jsvazic/hibernate-search-exampleBasically I am getting the following stack-trace when I try to initialize my Hibernate Search index:
org.hibernate.TransientObjectException: cannot lock an unsaved transient instance: com.example.hs.model.Inquiry
at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:75)
at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:724)
at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:717)
at org.hibernate.internal.SessionImpl.access$1700(SessionImpl.java:170)
at org.hibernate.internal.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2276)
at org.hibernate.search.batchindexing.impl.EntityConsumerLuceneWorkProducer.indexAllQueue(EntityConsumerLuceneWorkProducer.java:130)
at org.hibernate.search.batchindexing.impl.EntityConsumerLuceneWorkProducer.run(EntityConsumerLuceneWorkProducer.java:102)
at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:112)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
I do have a few @Transient fields in one of the associated objects, but I'm not sure how that may be related. Someone suggested that I set the cascade level to PERSIST, which I have tried, but it does not seem to work. I'm sure it is just a configuration issue somewhere, but for the life of me I can't figure out what it may be. Any help would be greatly appreciated.
Edit: Valid URL