java - Hibernate flush/commit collection owner not associated with session -


in our code have many many relation, relation table contains few additonal fields.

for example: have trip resources trip can have multiple equipments , equipment can reused. when equipment not used anymore removed. have following objects:

  • trip
  • equipment (equipment contains list data, i'll call wheels)
  • tripequipmentrelation

when replacing equipment on trip first

  • remove relation between equipment , tripequipmentrelation
  • remove relation between trip , tripequipmentrelation
  • remove tripequipmentrelation
  • because equipment not used anymore remove equipment itself.
  • add new equipment trip.

add point manual flush on session because need generate id's new objects. far good. when applicationserver tries commit session following error:

assertionfail e org.hibernate.assertionfailure <init> assertion failure occured (this may indicate bug in hibernate, more due unsafe use of session) org.hibernate.assertionfailure: collection owner not associated session equipment.wheels @ org.hibernate.engine.collections.processdereferencedcollection(collections.java:88) @ org.hibernate.engine.collections.processunreachablecollection(collections.java:39) 

even when wheels collection empty.

when removing flush save action succesfull. explain me why flushing session manually not working?

thx in advance


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -