Hi Rob,
We've got a highly-used query that has some intermittent failures. The query is raw sql (RawSqlBuilder.unparsed()) and the parent (ScheduledAssignment) has a member Role which is a single-table-inheritance class. I'm on 4.1.8 so I can't map the discriminator column. I have a FetchConfig.query() to preload the Roles (which suffers a bit since the foreign keys aren't loaded by the raw query, but it does work).
What does this traceback tell you?
javax.persistence.EntityNotFoundException: Bean has been deleted - lazy loading failed
at com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanIntercept.java:723)
at com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java:692)
at com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:779)
at com.opentempo.webapp.modeleb.ScheduledAssignment._ebean_get_role(ScheduledAssignment.java:4)
at com.opentempo.webapp.modeleb.ScheduledAssignment.getRole(ScheduledAssignment.java:183)
The obvious conclusion is that the row isn't in the database any more but we're pretty sure that's not the case.
First question, does this exception suggest the ScheduledAssignment has been deleted or the Role has been deleted?
Second, if we are building the root with Raw SQL, and populating the Role with FetchConfig.query(), what are the circumstances that could lead to this exception?
Thanks.
/Daryl