I am getting this error:
(net.sf.hibernate.AssertionFailure.<init>(AssertionFailure.java:22)) an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
net.sf.hibernate.AssertionFailure: collection was processed twice by flush()
the error repeats infinately...(until stack overflow) and maxes out my databases cpu at 100%. I is the root cause of the issue I posted last week
http://forum.hibernate.org/viewtopic.php?t=940440
what shoudl I be looking for....what types of situation would cause a colleciton to be processed twice by flush?
Paul
Hibernate version:
2.1.7
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Session session = HibernateUtil.currentSession();
Transaction trx = session.beginTransaction();
Query query = session.createQuery(sb.toString());
query.setParameter("catNum", catNum);
query.setMaxResults(1);
list = query.list();
trx.commit();
Full stack trace of any exception that occurs:
ERROR[2005-03-29 14:19:59,749](net.sf.hibernate.AssertionFailure.<init>(AssertionFailure.java:22)) an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
net.sf.hibernate.AssertionFailure: collection was processed twice by flush()
at net.sf.hibernate.impl.SessionImpl.prepareCollectionForUpdate(SessionImpl.java:2957)
at net.sf.hibernate.impl.SessionImpl.updateUnreachableCollection(SessionImpl.java:2946)
at net.sf.hibernate.impl.SessionImpl.flushCollections(SessionImpl.java:2808)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2281)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1814)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1577)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.crosslink.biz.inventory.InventoryItemBin.get(InventoryItemBin.java:146)
at com.crosslink.biz.cases.CaseUsageExternalItem.getInventoryItem(CaseUsageExternalItem.java:150)
at com.crosslink.biz.cases.CaseUsageExternalItem.getListPrice(CaseUsageExternalItem.java:134)
at com.crosslink.biz.cases.CaseUsageExternalItem.getPrice(CaseUsageExternalItem.java:179)
at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
///the block from this point to the end repeats until stack overflow
at java.lang.reflect.Method.invoke(Method.java:324)
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:96)
at net.sf.hibernate.persister.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:254)
at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2494)
at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2478)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2280)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1814)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1577)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.crosslink.biz.inventory.InventoryItemBin.get(InventoryItemBin.java:146)
at com.crosslink.biz.cases.CaseUsageExternalItem.getInventoryItem(CaseUsageExternalItem.java:150)
at com.crosslink.biz.cases.CaseUsageExternalItem.getListPrice(CaseUsageExternalItem.java:134)
at com.crosslink.biz.cases.CaseUsageExternalItem.getPrice(CaseUsageExternalItem.java:179)
at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
///end block repeating until stack overflow
Name and version of the database you are using:
SQL Server 2000
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: