Ok, somehow I've run across this. I got a couple of (8) entities mapped in various associations (uni- and bidirectional, one-to-many and one many-to-many mappings, plus 2 subclass mappings out of the 8 entities). I use no transactions, and I mapped most of the association with cascade="all" (our business model dictates so).
Now, when I try to do a plain session.delete (hibernateObject), I get the following exception:
Code:
net.sf.hibernate.HibernateException: Flush during cascade is dangerous - this might occur if an object was deleted and then re-saved by cascade
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2001)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:589)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1187)
..
I'd like to know exactly what this error means, usually when it happens, and what should I do to avoid it.. ofc I'd share all details if needed when this problem aint that much typical as I think it is..
thanks,
dyn