Hibernate version:3.0.5
Name and version of the database you are using: Oracle 10.1.0.2
I am not sure the problem is there but it seems that when I am executing the following HQL:
public List getDirtyForAccount(final Account a)
{
return (List) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Query query = session.createQuery("select ac from Campaign ac " +
"inner join ac.masterCampaign as mc " +
"where mc.account = :account and ac.dirty = 1")
.setEntity("account", a);
return query.list();
}
});
}
and the middle entity (masterCampaign) does not exist (the account entity is childless) i am getting the following exception:
Full stack trace of any exception that occurs: SEVERE: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: dirty, but no dirty properties at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:158) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:39) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:711) at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:895) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:885) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
the associations are: Account 1->m MasterCampaign 1->m Campaign
when there are master campaigns, there is no exception on the query.
I am using Spring 1.2.5 to manage the transactions using HibernateDaoSupport and HibernateTemplate.
thanks,
Tomer
|