IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

Row was updated or deleted by another transaction


Sujet :

Hibernate Java

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 72
    Points : 53
    Points
    53
    Par défaut Row was updated or deleted by another transaction
    Bonjour à toutes et à tous,

    voilà, j'ai un soucis bizarre avec hibernate... je vous explique:

    J'ai une application Web qui gère des données, et notamment une page qui, lorsqu'on la valide, insère un objet de type A et met à jour un objet de type B... jusque là, rien de bien folichon...

    Le problème est le suivant:
    lorsqu'on fait un premier appel à cette page, tout fonctionne sans aucun soucis et, une fois que l'objet est inséré/maj en base, il est détruit...
    mais lorsque je fais une recherche sur ce même objet, et que je revalide la page en faisant une petite modification sur l'objet j'ai l'erreur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
     
    org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.arsoebr.bdporc.metier.identification.bdporc.om.SiteDElevageOM#com.arsoebr.bdporc.metier.identification.bdni.om.SiteID@6b80292a]
    	at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1635)
    	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
    	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
    	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
    	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:91)
    	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
    	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
    	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
    	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
    	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
    	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
    	at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
    	at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1487)
    	at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:416)
    	at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:239)
    	at org.objectweb.jotm.Current.commit(Current.java:488)
    	at com.arsoebr.bdporc.web.delegationMetier.AbstractDelegationBase.commitTransaction(AbstractDelegationBase.java:122)
    	at com.arsoebr.bdporc.web.exploitation.miseAJour.delegationMetier.DelegationDeclarationActivite.InsererDeclarationActivite(DelegationDeclarationActivite.java:94)
    	at com.arsoebr.bdporc.web.exploitation.miseAJour.actions.ValiderDAResumeAction.valider(ValiderDAResumeAction.java:215)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
    	at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
    	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at com.arsoebr.bdporc.web.filtres.AbonneFilter.doFilter(AbonneFilter.java:95)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at com.arsoebr.bdporc.web.filtres.RendererFilter.doFilter(RendererFilter.java:113)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    	at java.lang.Thread.run(Thread.java:595)
    Nous avons 3 environnements utilisés:
    • un en dev en local qui pointe vers une base oracle de dev
    • un en qualification qui pointe vers une autre base oracle de qualification
    • un en préprod qui pointe vers une base oracle de pré prod

    Ces 3 environnements sont des tomcat identique et ce qui est très bizarre, c'est que je n'ai cette erreur que sur un des 3 environnements utilisés, celui de pré prod.

    Si quelqu'un a une piste... je suis preneur

    @+

  2. #2
    Membre chevronné
    Inscrit en
    Août 2009
    Messages
    1 073
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 1 073
    Points : 1 806
    Points
    1 806
    Par défaut
    C'est potentiellement un problème d'accès concurrent, qui apparait plus naturellement en pre-prod s'il y a pas mal de monde dessus et qu'ils accèdent au même objet.

    Edit : quelques questions ;
    - C'est systématique sur la pre-prod, même s'il n'y a qu'un seul utilisateur ?
    - Vous pouvez essayer de reproduire en Dev en chargeant le même objet, puis une personne fait une modif, puis l'autre fait une modif.

  3. #3
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Points : 9 529
    Points
    9 529
    Billets dans le blog
    1
    Par défaut
    Ça ressemble plus à un problème de cache.
    Peux-tu décrire exactement ce que tu fais, j'ai du mal à comprendre
    une fois que l'objet est inséré/maj en base, il est détruit...
    peux-tu également montrer le code ?

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 72
    Points : 53
    Points
    53
    Par défaut
    Citation Envoyé par Rei Ichido Voir le message
    C'est potentiellement un problème d'accès concurrent, qui apparait plus naturellement en pre-prod s'il y a pas mal de monde dessus et qu'ils accèdent au même objet.

    Edit : quelques questions ;
    - C'est systématique sur la pre-prod, même s'il n'y a qu'un seul utilisateur ?
    - Vous pouvez essayer de reproduire en Dev en chargeant le même objet, puis une personne fait une modif, puis l'autre fait une modif.
    Bonjour,

    Oui, c'est systématique sur la pré prod, même avec un seul utilisateur...

    Effectivement, le seul moyen pour le reproduire en dev, c'est de charger le même objet sur 2 navigateurs différents....

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 72
    Points : 53
    Points
    53
    Par défaut
    Citation Envoyé par OButterlin Voir le message
    Ça ressemble plus à un problème de cache.
    Peux-tu décrire exactement ce que tu fais, j'ai du mal à comprendre

    peux-tu également montrer le code ?
    Voici le code de mise à jour de l'objet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    // on recupere le site existant
    		final SiteDElevageOM siteBD = consulterSiteDelevage(siteModifie.getNumero(), siteModifie.getPays().getCode());
    		siteBD.setQui(getAbonne().getLogin());
     
    		try
    		{
    			FournisseurDeMajOM.getMajSiteDElevage().mettreAJourOM(siteBD, siteModifie, getAbonne());
    			IdentificationSessionManager.getCurrentSession().merge(siteBD);
    		}
    		catch(HibernateException e)
    		{
    			log.error("Erreur lors de la mise à jour du site : " + e.getMessage(), e);
    			throw new IdentificationBDPorcException("BDPORC-Identification-1012", e);
    		}
    sachant que la méthode mettreAJourOM change des valeurs (mais pas celle de la clé primaire biensûr....

    et le tout plante sur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
     
    String result = "";
    		boolean rollback = true;
    		try {
    			// Ouverture de la transaction
    			beginTransaction();
     
    			final EditionDeclarationActivite editionDA = FournisseurDeServices.getEditionDeclarationActivite();
    			editionDA.identifieAppelant(this.getAbonne());
    			result = editionDA.nouvelleDeclarationActivite(da, _site, _EstModifDA);
    			commitTransaction();
    			rollback = false;
    		} catch (InstantiationException e) {
    			LoggerBdporc.debug(this.getClass(), "InsererDeclarationActivite", getAbonne(), e, da);
    			throw e;
    		} catch (DelegationException e) {
    			LoggerBdporc.debug(this.getClass(), "InsererDeclarationActivite", getAbonne(), e, da);
    			throw e;
    		} catch (Exception e) {
    			LoggerBdporc.debug(this.getClass(), "InsererDeclarationActivite", getAbonne(), e, da);
    			throw new DelegationException(e.getMessage(), e);
    		} finally {
    			try {
    				if (rollback) {
    					rollbackTransaction();
    				}
    			} catch (DelegationException e) {
    				LoggerBdporc.fatal(this.getClass(), "InsererDeclarationActivite", getAbonne(), e, da);
    				throw e;
    			}
    		}
    plus particulièrement sur le commitTransaction...

  6. #6
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Points : 9 529
    Points
    9 529
    Billets dans le blog
    1
    Par défaut
    Peux-tu montrer le mapping de tes entités ainsi que le paramétrage Hibernate ?

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 72
    Points : 53
    Points
    53
    Par défaut
    Citation Envoyé par OButterlin Voir le message
    Peux-tu montrer le mapping de tes entités ainsi que le paramétrage Hibernate ?
    le mapping:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
     
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <!-- 
            Auto-generated mapping file from
            the hibernate.org cfg2hbm engine
    -->
        <class name="com.arsoebr.bdporc.metier.identification.bdni.om.SiteOM" table="RF_SITE"   lazy="true">
            <composite-id name="cle" 
            	class="com.arsoebr.bdporc.metier.identification.bdni.om.SiteID">
                <key-many-to-one name="pays" class="com.arsoebr.bdporc.metier.identification.bdni.om.PaysOM" lazy="false">
                    <column name="PAYS" length="2" not-null="true" />
                </key-many-to-one>
                <key-property name="numeroIdentification" type="string">
                    <column name="NUMERO_IDENTIFICATION" length="12" />
                </key-property>
            </composite-id>
            <timestamp column="QUAND" name="quand" source="db" access="field" unsaved-value="null" />
            <many-to-one name="exploitation" class="com.arsoebr.bdporc.metier.identification.bdni.om.ExploitationOM" lazy="proxy">
                <column name="RF_CODE_PAYS_EXP" length="2" />
                <column name="RF_NUMERO_IDENTIFICATION_EXP" length="12" />
            </many-to-one>
            <property name="miseAJourBdniEget" type="timestamp">
                <column name="MISE_A_JOUR_BDNI_EGET" length="11" />
            </property>
            <property name="miseAJourBdniRata" type="timestamp">
                <column name="MISE_A_JOUR_BDNI_RATA" length="11" />
            </property>
            <component name="adresse" class="com.arsoebr.bdporc.metier.identification.bdni.om.AdresseOM">
    			<property name="adresse1" type="string">
                <column name="ADRESSE1" length="30" />
    	        </property>
    	        <property name="adresse2" type="string">
    	            <column name="ADRESSE2" length="30" />
    	        </property>
    	        <property name="codeLocalisation" type="string">
    	            <column name="CODE_LOCALISATION" length="5" />
    	        </property>
    	        <property name="commune" type="string">
    	            <column name="COMMUNE" length="30" />
    	        </property>
    		</component>
            <property name="debutRattachement" type="date">
                <column name="DEBUT_RATTACHEMENT" length="7" />
            </property>
            <property name="qui" type="string">
                <column name="QUI" length="45" />
            </property>
            <!--one-to-one name="activite" property-ref="site" fetch="select" cascade="all"/-->
            <set name="activites" inverse="true" lazy="true" order-by="DEBUT desc" cascade="all" fetch="select">
                <key>
                    <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="RF_SITE_NUMERO_IDENTIFICATIO" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdni.om.ActiviteSiteOM" />
            </set>
        </class>
    </hibernate-mapping>
    et

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <!-- 
            Auto-generated mapping file from
            the hibernate.org cfg2hbm engine
    -->
        <joined-subclass 
        	name="com.arsoebr.bdporc.metier.identification.bdporc.om.SiteDElevageOM" 
        	extends="com.arsoebr.bdporc.metier.identification.bdni.om.SiteOM"
        	table="MT_SITE"  >
            <key>
            	<column name="RF_SITE_CODE_PAYS" />
                <column name="RF_SITE_NUMERO_IDENT" />
            </key>
            <!-- timestamp column="QUAND" name="quand" source="db" / -->
            <many-to-one name="typePleinAir" class="com.arsoebr.bdporc.metier.identification.bdporc.om.PleinAirOM" fetch="join" lazy="false">
                <column name="MT_PLEIN_AIR_CODE" length="2" />
            </many-to-one>
            <many-to-one name="typeProduction" class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypeProductionOM">
                <column name="MT_TYPE_PRODUCTION_CODE" length="2" />
            </many-to-one>
            <!--many-to-one name="siteBDNI" class="com.arsoebr.bdporc.metier.identification.bdni.om.SiteOM" update="false" insert="false">
                <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                <column name="RF_SITE_NUMERO_IDENT" length="12" not-null="true" />
            </many-to-one-->
            <many-to-one name="referentielGeographique" class="com.arsoebr.bdporc.metier.identification.bdporc.om.ReferentielGeoOM">
                <column name="RF_REFERENTIEL_GEO_CODE" length="2" />
            </many-to-one>
            <many-to-one name="typePorcin" class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypePorcinOM">
                <column name="MT_TYPE_PORCIN_CODE" length="2" />
            </many-to-one>
            <many-to-one name="typeElevage" class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypeElevageOM">
                <column name="MT_TYPE_ELEVAGE_CODE" length="2" />
            </many-to-one>
            <many-to-one name="responsableTechnique" class="com.arsoebr.bdporc.metier.identification.bdni.om.utilisateurs.InterlocuteurOM" lazy="proxy">
                <column name="RESPONSABLE_TECHNIQUE_PAYS" length="2" />
                <column name="RESPONSABLE_TECHNIQUE_NUMERO" length="12" />
            </many-to-one>
            <property name="placesPostSevrage" type="integer">
                <column name="PLACES_POST_SEVRAGE" precision="5" scale="0" />
            </property>
            <property name="placesEngraissement" type="integer">
                <column name="PLACES_ENGRAISSEMENT" precision="5" scale="0" />
            </property>
            <property name="placesReproducteurs" type="integer">
                <column name="PLACES_REPRODUCTEURS" precision="5" scale="0" />
            </property>
            <property name="geoCoordonneeX" type="integer">
                <column name="GEO_COORDONNEE_X" precision="10" scale="0" />
            </property>
            <property name="geoCoordonneeY" type="integer">
                <column name="GEO_COORDONNEE_Y" precision="10" scale="0" />
            </property>
            <property name="arretTemporaireDepuisLe" type="date">
                <column name="ARRET_TEMPORAIRE_DEPUIS" length="7" />
            </property>
            <component name="coordonnees" class="com.arsoebr.bdporc.metier.identification.bdporc.om.CoordonneesOM">
    			<property name="telephone1" type="string">
            	    <column name="TELEPHONE1" length="10" />
    	        </property>
        	    <property name="telephone2" type="string">
            	    <column name="TELEPHONE2" length="10" />
    	        </property>
    	        <property name="fax" type="string">
    	            <column name="FAX" length="10" />
        	    </property>
    	        <property name="email" type="string">
        	        <column name="EMAIL" length="80" />
    	        </property>
    		</component>
            <property name="responsableDepuisLe" type="date">
                <column name="RESPONSABLE_DEPUIS_LE" length="7" />
            </property>
            <set name="proprieteAnimaux" inverse="true">
                <key>
                    <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="RF_SITE_NUMERO_IDENT" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.ProprieteAnimauxOM" />
            </set>
            <!--set name="mtDescripteurMesures" inverse="true">
                <key>
                    <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="MT_SITE_NUMERO_IDENT" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.MtDescripteurMesure" />
            </set>
            <set name="HDescripteurMesures" inverse="true">
                <key>
                    <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="RF_SITE_NUMERO_IDENT" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.HDescripteurMesure" />
            </set>
            <set name="trMouvements" inverse="true">
                <key>
                    <column name="MT_SITE_CODE_PAYS" length="2" />
                    <column name="MT_SITE_NUMERO_IDENT" length="12" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.TrMouvement" />
            </set>
            <set name="mtIndicateurDuSites" inverse="true">
                <key>
                    <column name="MT_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="MT_SITE_NUMERO_IDENTIFICATIO" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.MtIndicateurDuSite" />
            </set>
            <set name="HDescripteurExiges" inverse="true">
                <key>
                    <column name="RF_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="RF_SITE_NUMERO_IDENT" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.HDescripteurExige" />
            </set>
            <set name="trPrecisionOrigines" inverse="true">
                <key>
                    <column name="MT_SITE_CODE_PAYS" length="2" not-null="true" />
                    <column name="MT_SITE_NUMERO_IDENT" length="12" not-null="true" />
                </key>
                <one-to-many class="com.arsoebr.bdporc.metier.identification.bdporc.om.TrPrecisionOrigine" />
            </set-->
        </joined-subclass>
    </hibernate-mapping>
    et le parametrage:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
     
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    	<session-factory name="BDPorc-Identification">
     
    		<!-- JDBC <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> 
    			<property name="hibernate.connection.password">BDPORC</property> <property 
    			name="hibernate.connection.url">jdbc:oracle:thin:@bdporcdev:1521:BDPDEV</property> 
    			<property name="hibernate.connection.username">BDPORC</property> <property 
    			name="hibernate.default_schema">BDPORC</property> -->
    		<property name="hibernate.connection.datasource">java:comp/env/jdbc/BDPorcDS</property>
    		<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
     
    		<!-- Pour le dev UNIQUEMENT -->
    		<property name="hibernate.cglib.use_reflection_optimizer">true</property>
    		<!-- Le parser AST n'est pas conforme sur les jointeures et les combinaisons 
    			OR / AND -->
    		<!-- property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property -->
    		<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
    		<property name="hibernate.show_sql">false</property>
    		<property name="hibernate.format_sql">true</property>
    		<property name="hibernate.max_fetch_depth">1</property>
     
    		<!-- Disable the second-level cache -->
    		<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
    		<property name="cache.use_query_cache">false</property>
    		<property name="cache.use_second_level_cache">true</property>
     
    		<!-- Configuration JTA -->
    		<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
    		<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOTMTransactionManagerLookup</property>
    		<property name="hibernate.current_session_context_class">jta</property>
    		<property name="hibernate.connection.release_mode">after_statement</property>
    		<!-- <property name="hibernate.transaction.auto_close_session">true</property> 
    			<property name="hibernate.connection.autocommit">false</property> -->
    		<!-- Typages généraux -->
    		<property name="hibernate.query.substitutions">true=1, false=0</property>
     
    	<mapping 
    	      resource="com/arsoebr/bdporc/metier/utilisateurs/om/Departement.hbm.xml"/>
     
    	<mapping 
    	      resource="com/arsoebr/bdporc/metier/utilisateurs/om/Profil.hbm.xml"/>
     
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/PleinAirOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/ProprieteAnimauxOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/ReferentielGeoOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/SiteDElevageOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/TypeElevageOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/TypePorcinOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/TypeProductionOM.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/ExploitationDifferentiel.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/InterlocuteurDifferentiel.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/GroupementDifferentiel.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/OperateurTransport.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/ParticipationAuGroupement.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/DeclarationActiviteDescription.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/DeclarationActiviteDonneesProfessionnelles.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/DeclarationActiviteDonneesReglementaires.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/DeclarationActiviteQualification.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/DeclarationActiviteResponsableTechnique.hbm.xml" />
     
    	    <mapping 
    	    	resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/ValeurDeDescripteur.hbm.xml" />
    	  	<mapping 
    	  		resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/InscriptionDepartementale.hbm.xml" />
    	  	<mapping 
    	  		resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/Indicateur.hbm.xml" />
    	  	<mapping 
    	  		resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/Descripteur.hbm.xml" />
    	    <mapping 
    	    	resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/Abonne.hbm.xml"/>	
    	    <mapping 
    	    	resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/ResponsabiliteIndicateur.hbm.xml"/>		
    	    <mapping 
    	    	resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/GroupementAffilieIndicateur.hbm.xml"/>
    		<mapping 
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/IndicateurDifferentiel.hbm.xml" />
    		<mapping 
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/om/indicateur/MesureDeDescripteur.hbm.xml" />
     
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/Exploitation.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/Pays.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/Civilite.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/utilisateurs/Interlocuteur.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/TypeExploitation.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/ActiviteExploitation.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/ActiviteSite.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/Site.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/HistoriqueDetentionExploitation.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/HistoriqueRattachementExploitation.hbm.xml" />
    		<!-- <mapping resource="com/arsoebr/bdporc/metier/identification/bdni/om/Partenariat.hbm.xml"/> 
    			<mapping resource="com/arsoebr/bdporc/metier/identification/bdni/om/Groupement.hbm.xml"/> 
    			<mapping resource="com/arsoebr/bdporc/metier/identification/bdni/om/ParticipationAuGroupement.hbm.xml"/> 
    			<mapping resource="com/arsoebr/bdporc/metier/identification/bdni/om/ParticipationAuPartenariat.hbm.xml"/> 
    			<mapping resource="com/arsoebr/bdporc/metier/identification/bdni/om/TypeRelation.hbm.xml"/> -->
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/om/PerimetreOT.hbm.xml" />
     
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/exploitation.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/proprieteAnimaux.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/siteDElevage.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/interlocuteur.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/consultationRefBDPORC.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/miseAJourHistorique.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/exportDifferentiel.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/exploitation.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/typeExploitation.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/historiqueIdentification.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/Civilite.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/importBDNI.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/suppHistoriqueImportBDNI.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdni/securite/requetes/site.requetes.hbm.xml" />
    		<mapping
    			resource="com/arsoebr/bdporc/metier/identification/bdporc/securite/requetes/declarationActivite.requetes.hbm.xml" />
     
     
    		<!-- CACHE des Classes mappées -->
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.ActiviteExploitationOM"
    			usage="read-write" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.ActiviteSiteOM"
    			usage="read-write" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.CiviliteOM"
    			usage="read-only" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.ExploitationOM"
    			usage="read-write" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.HistoriqueDetentionExploitationOM"
    			usage="read-write" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.HistoriqueRattachementExploitationOM"
    			usage="read-write" region="bdni" />
    		<!-- <class-cache class="com.arsoebr.bdporc.metier.identification.bdni.om.utilisateurs.InterlocuteurOM" 
    			usage="read-only" region="bdni.utilisateurs"/> -->
    		<class-cache class="com.arsoebr.bdporc.metier.identification.bdni.om.PaysOM"
    			usage="read-only" region="bdni" />
    		<class-cache class="com.arsoebr.bdporc.metier.identification.bdni.om.SiteOM"
    			usage="read-write" region="bdni" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdni.om.TypeExploitationOM"
    			usage="read-only" region="bdni" />
     
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.ExploitationDifferentielOM"
    			usage="read-write" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.InterlocuteurDifferentielOM"
    			usage="read-write" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.PleinAirOM"
    			usage="read-only" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.ProprieteAnimauxOM"
    			usage="read-write" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.ReferentielGeoOM"
    			usage="read-only" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypeElevageOM"
    			usage="read-only" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypePorcinOM"
    			usage="read-only" region="bdporc" />
    		<class-cache
    			class="com.arsoebr.bdporc.metier.identification.bdporc.om.TypeProductionOM"
    			usage="read-write" region="bdporc" />
    	<!-- <class-cache -->
    	<!-- class="com.arsoebr.bdporc.metier.identification.bdporc.om.DeclarationActiviteDescriptionOM" -->
    	<!-- usage="read-write" region="bdporc" /> -->
    	<!-- <class-cache -->
    	<!-- class="com.arsoebr.bdporc.metier.identification.bdporc.om.DeclarationActiviteDonneesProfessionnellesOM" -->
    	<!-- usage="read-write" region="bdporc" /> -->
    	<!-- <class-cache -->
    	<!-- class="com.arsoebr.bdporc.metier.identification.bdporc.om.DeclarationActiviteDonneesReglementairesOM" -->
    	<!-- usage="read-write" region="bdporc" /> -->
    	<!-- <class-cache -->
    	<!-- class="com.arsoebr.bdporc.metier.identification.bdporc.om.DeclarationActiviteQualificationOM" -->
    	<!-- usage="read-write" region="bdporc" /> -->
    	<!-- <class-cache -->
    	<!-- class="com.arsoebr.bdporc.metier.identification.bdporc.om.DeclarationActiviteResponsableTechniqueOM" -->
    	<!-- usage="read-write" region="bdporc" /> -->
     
    	</session-factory>
    </hibernate-configuration>
    Merci d'avance pour votre aide

  8. #8
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 313
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 313
    Points : 9 529
    Points
    9 529
    Billets dans le blog
    1
    Par défaut
    As-tu bien codé les méthodes equals et hasCode de tes entity ?

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 72
    Points : 53
    Points
    53
    Par défaut
    Citation Envoyé par OButterlin Voir le message
    As-tu bien codé les méthodes equals et hasCode de tes entity ?
    Oui, tout était bien codé, j'ai rajouté un flush avant ma recherche, et c'est tout bon....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 06/08/2014, 11h26
  2. Update et delete en Hibernate dans une transaction
    Par bernidupont dans le forum Hibernate
    Réponses: 1
    Dernier message: 05/12/2012, 14h28
  3. Obtenir code retour requête UPDATE et DELETE
    Par SurfingJeff dans le forum SQL
    Réponses: 3
    Dernier message: 02/08/2006, 12h27
  4. [trigger] insert update et delete
    Par kooljy dans le forum MS SQL Server
    Réponses: 6
    Dernier message: 13/07/2006, 08h56
  5. Evenement sur UPDATE, INSERT, DELETE
    Par papouAlain dans le forum Langage SQL
    Réponses: 6
    Dernier message: 23/12/2004, 14h58

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo