Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate calls flush on find- causes not-null error
    primarykey
    data
    text
    <p>I have a process which updates a tree to the database, and in doing so, performs reads to check for duplicates entities.</p> <p>I'm finding that trying to do a criteria.uniqueResult() midway through this process causes the following error:</p> <blockquote> <p>org.hibernate.PropertyValueException: not-null property references a null or transient value</p> </blockquote> <p>Digging through the stack trace, I see that the uniqueResult() is flushing the session, attempting to perform updates that aren't ready to go to the database yet.</p> <pre><code>at org.hibernate.engine.Cascade.cascade(Cascade.java:153) at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:154) at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:145) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:58) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328) at com.inversion.dal.BaseDAO.findUniqueByCriterion(BaseDAO.java:59) </code></pre> <p>Have I set something up wrong here?</p> <p>Any help greatly appreciated.</p> <p>Marty</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload