-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Strange problem
PostPosted: Thu May 19, 2005 7:58 pm 
Newbie

Joined: Wed Apr 27, 2005 9:53 am
Posts: 10
Hi, i have a strange problem with hibernate 3.0

Given 3 entities : Menu, Contenant, Contenu
Menu contain one-to-one with Contenant and Contenant is one-to_many with Contenu

When I delete the Menu entity, Contenant is deleted if no Contenu is binded to Contenant. But if I some Contenu are binded to Contenant, the deletion of Menu throw an exception. I got that kind of message

Could not execute JDBC batch update [update Contenu set contenantId=null where contenantId=?]

Why it try to update Contenu since it should be supposed to only delete it ?
I included stack trace (log4j activated)

See below the bold words

<class name="ca.qc.gouv.srcq.db.entity.Menu" table="Menu">
<id name="menuId">
<generator class="identity"/>
</id>
<property name="ordre"/>
<property name="sectionId"/>
<property name="brancheId"/>
<property name="actif"/>
<property name="type"/>
<many-to-one name="section" class="ca.qc.gouv.srcq.db.entity.Section" column="sectionId" insert="false" update="false"/>
<many-to-one name="branche" class="ca.qc.gouv.srcq.db.entity.Branche" column="brancheId" insert="false" update="false"/>
<one-to-one name="contenant" class="ca.qc.gouv.srcq.db.entity.Contenant" property-ref="menuId" cascade="all"/>
<dynamic-component name="locales">
<one-to-one name="en" class="ca.qc.gouv.srcq.db.entity.MenuEN" cascade="delete-orphan"/>
<one-to-one name="fr" class="ca.qc.gouv.srcq.db.entity.MenuFR" cascade="delete-orphan"/>
</dynamic-component>
</class>

<class name="ca.qc.gouv.srcq.db.entity.Contenant" table="Contenant">
<id name="contenantId">
<generator class="identity"/>
</id>
<property name="menuId"/>
<many-to-one name="menu" class="ca.qc.gouv.srcq.db.entity.Menu" column="menuId" insert="false" update="false"/>
<set name="contenus" order-by="dateModification desc" lazy="true" cascade="delete">
<key column="contenantId"/>
<one-to-many class="ca.qc.gouv.srcq.db.entity.Contenu"/>
</set>

<set name="themes" order-by="ordre" lazy="true">
<key column="contenantId"/>
<one-to-many class="ca.qc.gouv.srcq.db.entity.Theme"/>
</set>
<dynamic-component name="locales">
<one-to-one name="en" class="ca.qc.gouv.srcq.db.entity.ContenantEN" cascade="delete-orphan"/>
<one-to-one name="fr" class="ca.qc.gouv.srcq.db.entity.ContenantFR" cascade="delete-orphan"/>
</dynamic-component>
</class>

<class name="ca.qc.gouv.srcq.db.entity.Contenu" table="Contenu">
<id name="contenuId">
<generator class="identity"/>
</id>
<property name="contenantId"/>
<property name="dateCreation"/>
<property name="dateModification"/>
<property name="themeId"/>
<property name="actif"/>
<property name="image"/>
<many-to-one name="contenant" class="ca.qc.gouv.srcq.db.entity.Contenant" column="contenantId" insert="false" update="false"/>
<many-to-one name="theme" class="ca.qc.gouv.srcq.db.entity.Theme" column="themeId" insert="false" update="false"/>
<set name="documents" table="ContenuDocument" order-by="documentId" cascade="all,delete-orphan">
<key column="contenuId"/>
<many-to-many column="documentId" class="ca.qc.gouv.srcq.db.entity.Document" unique="true"/>
</set>
<dynamic-component name="locales">
<one-to-one name="en" class="ca.qc.gouv.srcq.db.entity.ContenuEN" cascade="delete-orphan"/>
<one-to-one name="fr" class="ca.qc.gouv.srcq.db.entity.ContenuFR" cascade="delete-orphan"/>
</dynamic-component>
</class>


STACK TRACE

DEBUG [org.hibernate.transaction.JDBCTransaction][19-05-2005 19:52:13]: begin
DEBUG [org.hibernate.transaction.JDBCTransaction][19-05-2005 19:52:13]: current autocommit status: true
DEBUG [org.hibernate.transaction.JDBCTransaction][19-05-2005 19:52:13]: disabling autocommit
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.Menu#45]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Menu
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.Contenant
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.Contenant#34]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenant
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascade ACTION_DELETE for collection: ca.qc.gouv.srcq.db.entity.Contenant.contenus
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: initializing collection [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: checking second-level cache
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: collection not cached
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: loading collection: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [org.hibernate.SQL][19-05-2005 19:52:13]: select contenus0_.contenantId as contenan2___, contenus0_.contenuId as contenuId__, contenus0_.contenuId as contenuId2_, contenus0_.contenantId as contenan2_11_2_, contenus0_.dateCreation as dateCrea3_11_2_, contenus0_.dateModification as dateModi4_11_2_, contenus0_.themeId as themeId11_2_, contenus0_.actif as actif11_2_, contenus0_.image as image11_2_, contenuen1_.contenuId as contenuId0_, contenuen1_.titre as titre13_0_, contenuen1_.description as descript3_13_0_, contenufr2_.contenuId as contenuId1_, contenufr2_.titre as titre14_1_, contenufr2_.description as descript3_14_1_ from Contenu contenus0_ left outer join contenu_en contenuen1_ on contenus0_.contenuId=contenuen1_.contenuId left outer join contenu_fr contenufr2_ on contenus0_.contenuId=contenufr2_.contenuId where contenus0_.contenantId=? order by contenus0_.dateModification desc
Hibernate: select contenus0_.contenantId as contenan2___, contenus0_.contenuId as contenuId__, contenus0_.contenuId as contenuId2_, contenus0_.contenantId as contenan2_11_2_, contenus0_.dateCreation as dateCrea3_11_2_, contenus0_.dateModification as dateModi4_11_2_, contenus0_.themeId as themeId11_2_, contenus0_.actif as actif11_2_, contenus0_.image as image11_2_, contenuen1_.contenuId as contenuId0_, contenuen1_.titre as titre13_0_, contenuen1_.description as descript3_13_0_, contenufr2_.contenuId as contenuId1_, contenufr2_.titre as titre14_1_, contenufr2_.description as descript3_14_1_ from Contenu contenus0_ left outer join contenu_en contenuen1_ on contenus0_.contenuId=contenuen1_.contenuId left outer join contenu_fr contenufr2_ on contenus0_.contenuId=contenufr2_.contenuId where contenus0_.contenantId=? order by contenus0_.dateModification desc
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: preparing statement
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: binding '34' to parameter: 1
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result set contains (possibly empty) collection: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: uninitialized collection: initializing
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: processing result set
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result set row: 0
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning null as column: contenuId0_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '13' as column: contenuId1_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '13' as column: contenuId2_
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result row: null, EntityKey[ca.qc.gouv.srcq.db.entity.ContenuFR#13], EntityKey[ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: Initializing object from ResultSet: [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.persister.entity.BasicEntityPersister][19-05-2005 19:52:13]: Hydrating entity: [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: titre14_1_
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: descript3_14_1_
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: Initializing object from ResultSet: [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.persister.entity.BasicEntityPersister][19-05-2005 19:52:13]: Hydrating entity: [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '34' as column: contenan2_11_2_
DEBUG [org.hibernate.type.TimestampType][19-05-2005 19:52:13]: returning '2005-05-19 19:41:03' as column: dateCrea3_11_2_
DEBUG [org.hibernate.type.TimestampType][19-05-2005 19:52:13]: returning '2005-05-19 19:41:03' as column: dateModi4_11_2_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '0' as column: themeId11_2_
DEBUG [org.hibernate.type.BooleanType][19-05-2005 19:52:13]: returning 'false' as column: actif11_2_
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: image11_2_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '34' as column: contenan2_11_2_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '0' as column: themeId11_2_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '34' as column: contenan2___
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: found row of collection: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: reading row
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '13' as column: contenuId__
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity found in session cache
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: resolved object in session cache: [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: done processing result set (1 rows)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: closing statement
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: total objects hydrated: 2
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: resolving associations for [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: done materializing entity [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: resolving associations for [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.Contenant#34]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity found in session cache
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.Contenant#34]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: resolved object in session cache: [ca.qc.gouv.srcq.db.entity.Contenant#34]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.Theme#0]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: creating new proxy for entity
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: creating collection wrapper:[ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.ContenuEN#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.ContenuEN#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity does not exist
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity found in session cache
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: resolved object in session cache: [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: done materializing entity [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: 1 collections were found in result set
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: collection fully initialized: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: 1 collections initialized
DEBUG [org.hibernate.engine.PersistenceContext][19-05-2005 19:52:13]: initializing non-lazy collections
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: done loading collection
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: collection initialized
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.Contenu
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.Contenu#13]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenu
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascade ACTION_DELETE for collection: ca.qc.gouv.srcq.db.entity.Contenu.documents
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: initializing collection [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: checking second-level cache
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: collection not cached
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: loading collection: [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [org.hibernate.SQL][19-05-2005 19:52:13]: select documents0_.contenuId as contenuId__, documents0_.documentId as documentId__, document1_.documentId as documentId0_, documenten2_.documentId as documentId1_, documenten2_.titre as titre19_1_, documenten2_.url as url19_1_, documenten2_.source as source19_1_, documentfr3_.documentId as documentId2_, documentfr3_.titre as titre20_2_, documentfr3_.url as url20_2_, documentfr3_.source as source20_2_ from ContenuDocument documents0_ inner join document document1_ on documents0_.documentId=document1_.documentId left outer join document_en documenten2_ on document1_.documentId=documenten2_.documentId left outer join document_fr documentfr3_ on document1_.documentId=documentfr3_.documentId where documents0_.contenuId=? order by documents0_.documentId
Hibernate: select documents0_.contenuId as contenuId__, documents0_.documentId as documentId__, document1_.documentId as documentId0_, documenten2_.documentId as documentId1_, documenten2_.titre as titre19_1_, documenten2_.url as url19_1_, documenten2_.source as source19_1_, documentfr3_.documentId as documentId2_, documentfr3_.titre as titre20_2_, documentfr3_.url as url20_2_, documentfr3_.source as source20_2_ from ContenuDocument documents0_ inner join document document1_ on documents0_.documentId=document1_.documentId left outer join document_en documenten2_ on document1_.documentId=documenten2_.documentId left outer join document_fr documentfr3_ on document1_.documentId=documentfr3_.documentId where documents0_.contenuId=? order by documents0_.documentId
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: preparing statement
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: binding '13' to parameter: 1
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result set contains (possibly empty) collection: [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: uninitialized collection: initializing
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: processing result set
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result set row: 0
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '31' as column: documentId0_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning null as column: documentId1_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '31' as column: documentId2_
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: result row: EntityKey[ca.qc.gouv.srcq.db.entity.Document#31], null, EntityKey[ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: Initializing object from ResultSet: [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.persister.entity.BasicEntityPersister][19-05-2005 19:52:13]: Hydrating entity: [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: Initializing object from ResultSet: [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.persister.entity.BasicEntityPersister][19-05-2005 19:52:13]: Hydrating entity: [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: titre20_2_
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: url20_2_
DEBUG [org.hibernate.type.StringType][19-05-2005 19:52:13]: returning '1' as column: source20_2_
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '13' as column: contenuId__
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: found row of collection: [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: reading row
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: returning '31' as column: documentId__
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity found in session cache
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: resolved object in session cache: [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: done processing result set (1 rows)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: closing statement
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: total objects hydrated: 2
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: resolving associations for [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.DocumentEN#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.DocumentEN#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity does not exist
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: loading entity: [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: entity found in session cache
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: attempting to resolve: [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.event.def.DefaultLoadEventListener][19-05-2005 19:52:13]: resolved object in session cache: [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: done materializing entity [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: resolving associations for [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.engine.TwoPhaseLoad][19-05-2005 19:52:13]: done materializing entity [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: 1 collections were found in result set
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: collection fully initialized: [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.engine.CollectionLoadContext][19-05-2005 19:52:13]: 1 collections initialized
DEBUG [org.hibernate.engine.PersistenceContext][19-05-2005 19:52:13]: initializing non-lazy collections
DEBUG [org.hibernate.loader.Loader][19-05-2005 19:52:13]: done loading collection
DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener][19-05-2005 19:52:13]: collection initialized
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.Document
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.Document#31]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Document
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.DocumentFR
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.DocumentFR#31]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Document
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Document
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Document
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done cascade ACTION_DELETE for collection: ca.qc.gouv.srcq.db.entity.Contenu.documents
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: deleting orphans for collection: ca.qc.gouv.srcq.db.entity.Contenu.documents
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done deleting orphans for collection: ca.qc.gouv.srcq.db.entity.Contenu.documents
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.ContenuFR
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.ContenuFR#13]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenu
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenu
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenu
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done cascade ACTION_DELETE for collection: ca.qc.gouv.srcq.db.entity.Contenant.contenus
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.ContenantFR
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.ContenantFR#34]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenant
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenant
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Contenant
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: cascading to delete: ca.qc.gouv.srcq.db.entity.MenuFR
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting a persistent instance
DEBUG [org.hibernate.event.def.DefaultDeleteEventListener][19-05-2005 19:52:13]: deleting [ca.qc.gouv.srcq.db.entity.MenuFR#45]
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Menu
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: IGNORE
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: GET
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Menu
DEBUG [org.hibernate.engine.Cascades][19-05-2005 19:52:13]: done processing cascade ACTION_DELETE for: ca.qc.gouv.srcq.db.entity.Menu
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: setting cache mode to: IGNORE
DEBUG [org.hibernate.transaction.JDBCTransaction][19-05-2005 19:52:13]: commit
DEBUG [org.hibernate.impl.SessionImpl][19-05-2005 19:52:13]: automatically flushing session
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: flushing session
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: processing flush-time cascades
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: dirty checking collections
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: Flushing entities and processing referenced collections
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: Processing unreferenced collections
DEBUG [org.hibernate.engine.Collections][19-05-2005 19:52:13]: Collection dereferenced: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.engine.Collections][19-05-2005 19:52:13]: Collection dereferenced: [ca.qc.gouv.srcq.db.entity.Contenant.themes#34]
DEBUG [org.hibernate.engine.Collections][19-05-2005 19:52:13]: Collection dereferenced: [ca.qc.gouv.srcq.db.entity.Contenu.documents#13]
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: Scheduling collection removes/(re)creates/updates
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: Flushed: 0 insertions, 0 updates, 8 deletions to 8 objects
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: Flushed: 0 (re)creations, 0 updates, 3 removals to 3 collections
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: listing entities:
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.DocumentFR{titre=1, documentId=31, url=1, source=1}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.MenuFR{menuId=45, url=, nom=1}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.ContenantFR{contenantId=34, titre=1, description=1}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.Menu{section=ca.qc.gouv.srcq.db.entity.Section#1, menuId=45, actif=false, type=dynamique, contenant=ca.qc.gouv.srcq.db.entity.Contenant#34, locales=component[en,fr]{en=null, fr=ca.qc.gouv.srcq.db.entity.MenuFR#45}, branche=ca.qc.gouv.srcq.db.entity.Branche#7, ordre=0, sectionId=1, brancheId=7}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.Contenu{contenantId=34, themeId=0, dateCreation=2005-05-19 19:41:03, theme=ca.qc.gouv.srcq.db.entity.Theme#0, actif=false, contenant=ca.qc.gouv.srcq.db.entity.Contenant#34, locales=component[en,fr]{en=null, fr=ca.qc.gouv.srcq.db.entity.ContenuFR#13}, image=1, contenuId=13, dateModification=2005-05-19 19:41:03, documents=[ca.qc.gouv.srcq.db.entity.Document#31]}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.Contenant{themes=<uninitialized>, contenantId=34, menuId=45, locales=component[en,fr]{en=null, fr=ca.qc.gouv.srcq.db.entity.ContenantFR#34}, contenus=[ca.qc.gouv.srcq.db.entity.Contenu#13], menu=ca.qc.gouv.srcq.db.entity.Menu#45}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.ContenuFR{titre=1, description=1, contenuId=13}
DEBUG [org.hibernate.pretty.Printer][19-05-2005 19:52:13]: ca.qc.gouv.srcq.db.entity.Document{locales=component[en,fr]{en=null, fr=ca.qc.gouv.srcq.db.entity.DocumentFR#31}, documentId=31}
DEBUG [org.hibernate.event.def.AbstractFlushingEventListener][19-05-2005 19:52:13]: executing flush
DEBUG [org.hibernate.persister.collection.AbstractCollectionPersister][19-05-2005 19:52:13]: Deleting collection: [ca.qc.gouv.srcq.db.entity.Contenant.contenus#34]
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [org.hibernate.SQL][19-05-2005 19:52:13]: update Contenu set contenantId=null where contenantId=?
Hibernate: update Contenu set contenantId=null where contenantId=?
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: preparing statement
DEBUG [org.hibernate.type.IntegerType][19-05-2005 19:52:13]: binding '34' to parameter: 1
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: Adding to batch
DEBUG [org.hibernate.persister.collection.AbstractCollectionPersister][19-05-2005 19:52:13]: done deleting collection
DEBUG [org.hibernate.persister.collection.AbstractCollectionPersister][19-05-2005 19:52:13]: Deleting collection: [ca.qc.gouv.srcq.db.entity.Contenant.themes#34]
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: Executing batch size: 1
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher][19-05-2005 19:52:13]: closing statement
DEBUG [org.hibernate.util.JDBCExceptionReporter][19-05-2005 19:52:13]: Could not execute JDBC batch update [update Contenu set contenantId=null where contenantId=?]
java.sql.BatchUpdateException: null, message from server: "Cannot add or update a child row: a foreign key constraint fails"
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1404)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:172)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:72)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:67)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:148)
at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:809)
at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:22)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 9:58 pm 
Newbie

Joined: Wed Apr 27, 2005 9:53 am
Posts: 10
When in the Contenant entity mapping i changed this

<set name="activeContenus" order-by="dateModification desc" lazy="true" where="actif=1">
<key column="contenantId"/>
<one-to-many class="ca.qc.gouv.srcq.db.entity.Contenu"/>
</set>

to

<set name="activeContenus" order-by="dateModification desc" lazy="true" where="actif=1">
<key column="contenantId" update="false"/>
<one-to-many class="ca.qc.gouv.srcq.db.entity.Contenu"/>
</set>

It's working, why i have to do that ? I have some similar relations on other entities and I don't have to do that... I am very confuse...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.