-->
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.  [ 3 posts ] 
Author Message
 Post subject: (Strange) Bad performance on a Pojo
PostPosted: Fri Oct 03, 2008 8:19 am 
Newbie

Joined: Sat Apr 29, 2006 9:52 am
Posts: 8
Hibernate version: 3.2.3.ga
Ehcache version : 1.3.0
Oracle 10.1.2.0

Hi guys,

I've got a weird behavior when I try to retrieve a few pojos. I use Ehcache for the second level cache.
the pojo is "EntitePce" and the query is quite simple:
"from EntitePce" that's all.
Well, the Pojo is huge (lot's of attributes/columns) but the table's got only about 500 lines.
The queryCache is enabled and doesn't change anything.
Even when I have the data in the session cache it's still slow:
first time: 1150ms
average time (without counting the first time): 500ms

usually I've got time about 10ms once in the cache, that's why I asking that question. I must have something wrong

If you've got an idea let me know.

here is the EntitePce.hbm.xml (careful it's big) :


[code]
<?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>
<class name="com.rte.emma.communs.modeles.pojos.EntitePce"
table="ENTITE_PCE">
<id name="id" type="long">
<column name="ID" precision="22" scale="0" />
<generator class="sequence">
<param name="sequence">SEQ_Entite_Pce</param>
</generator>
</id>
<many-to-one name="dispatchingRTE"
class="com.rte.emma.communs.modeles.pojos.DispatchingRTE"
fetch="select">
<column name="IDDISPATCHINGRTE" precision="22" scale="0"
not-null="true" />
</many-to-one>
<many-to-one name="acteur"
class="com.rte.emma.communs.modeles.pojos.Acteur" fetch="select">
<column name="IDRE" precision="22" scale="0"
not-null="true" />
</many-to-one>
<property name="dateDebutValidite" type="timestamp"
access="field">
<column name="DATEDEBUTVALIDITE" unique="true" length="7" />
</property>
<property name="dateFinValidite" type="timestamp">
<column name="DATEFINVALIDITE" length="7" />
</property>
<property name="nom" type="string">
<column name="NOM" length="50" />
</property>
<property name="identifiant" type="string">
<column name="IDENTIFIANT" length="20" not-null="true"
unique="true" />
</property>
<property name="type" type="short" access="field">
<column name="TYPE" precision="2" scale="0" not-null="true" />
</property>
<property name="role" type="short" access="field">
<column name="ROLE" precision="1" scale="0" not-null="true" />
</property>
<property name="dnProgrammation" type="short">
<column name="DNPROGRAMMATION" precision="3" scale="0" />
</property>

<bag name="energieDemarrages" inverse="true" cascade="all"
access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.EnergieDemarrage" />
</bag>

<!-- ************ Les volumes *******************-->
<bag name="volumeOrdresJs" where=" JOUR='0'" inverse="true"
cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeOrdre" />
</bag>
<bag name="volumeOrdresJPlus1s" where=" JOUR='1'" inverse="true"
cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeOrdre" />
</bag>

<bag name="volumeTravailOrdresJs" where=" JOUR='0'"
inverse="true" cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeTravailOrdre" />
</bag>
<bag name="volumeTravailOrdresJPlus1s" where=" JOUR='1'"
inverse="true" cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeTravailOrdre" />
</bag>

<bag name="volumeTravailCopieOrdresJs" where=" JOUR='0'"
inverse="true" cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeTravailCopieOrdre" />
</bag>
<bag name="volumeTravailCopieOrdresJPlus1s" where=" JOUR='1'"
inverse="true" cascade="all">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.VolumeTravailCopieOrdre" />
</bag>


<!-- ********** Regroupement des contraintes des entité Pce -->
<component name="ctEntitePceJ"
class="com.rte.emma.communs.modeles.pojos.RgptCtEntitePce">
<parent name="entitePce" />

<bag name="ctEntitePce" inverse="true" cascade="all"
where=" JOUR ='0'" access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.CtEntitePce" />
</bag>

<bag name="commentaireCt" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '151' and JOUR='0'" access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>
<bag name="fortuit" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '155' and JOUR='0'" access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>
</component>
<component name="ctEntitePceJPlus1"
class="com.rte.emma.communs.modeles.pojos.RgptCtEntitePce">

<parent name="entitePce" />

<bag name="ctEntitePce" inverse="true" cascade="all"
where=" JOUR ='1'" access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.CtEntitePce" />
</bag>

<bag name="fortuit" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '155' and JOUR='1'" access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>

<bag name="commentaireCt" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '151' and JOUR='1'" access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>
</component>

<component name="ctEntitePceAi"
class="com.rte.emma.communs.modeles.pojos.RgptCtEntitePceAi">
<parent name="entitePce" />

<bag name="airCommentaireCt" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '152'" access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>

<bag name="airFortuit" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '156'" access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtEntitePce" />
</bag>
</component>

<component name="ctCeInitJ"
class="com.rte.emma.communs.modeles.pojos.RgptCtCe">

<parent name="entitePce" />

<bag name="d0MinBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '82' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MinHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '81' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '80' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '79' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '83' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '84' and JOUR='0' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>
</component>


<component name="ctCeInitJPlus1"
class="com.rte.emma.communs.modeles.pojos.RgptCtCe">

<parent name="entitePce" />

<bag name="d0MinBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '82' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MinHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '81' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '80' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '79' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '83' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '84' and JOUR='1' and COURANT='0'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>
</component>


<component name="ctCeCourantJ"
class="com.rte.emma.communs.modeles.pojos.RgptCtCe">

<parent name="entitePce" />

<bag name="d0MinBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '82' and JOUR='0' and COURANT='1'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MinHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '81' and JOUR='0' and COURANT='1'"
access="field">

<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '80' and JOUR='0' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '79' and JOUR='0' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '83' and JOUR='0' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '84' and JOUR='0' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>
</component>


<component name="ctCeCourantJPlus1"
class="com.rte.emma.communs.modeles.pojos.RgptCtCe">

<parent name="entitePce" />

<bag name="d0MinBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '82' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MinHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '81' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '80' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="d0MaxHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '79' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationHausses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '83' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>

<bag name="nbActivationBaisses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '84' and JOUR='1' and COURANT='1'"
access="field">
<key on-delete="cascade">
<column name="IDCE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueCtCe" />
</bag>
</component>

<!-- ************* FIN DES REGOURPEMENT POUR LES CT CE -->

<!-- ************** REgroupement des programmes *********-->

<component name="modifProgramme"
class="com.rte.emma.communs.modeles.pojos.RgptModificationProgramme">

<parent name="entitePce" />

<bag name="consignes" inverse="true" cascade="all"
where=" TYPE='0' AND AI='0'" access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ModificationProgramme" />
</bag>

<bag name="redeclarations" inverse="true" cascade="all"
where=" TYPE='1' AND AI='0' " access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ModificationProgramme" />
</bag>
<bag name="aiConsignes" inverse="true" cascade="all"
where=" TYPE='0' AND AI='1'" access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ModificationProgramme" />
</bag>
<bag name="aiRedeclarations" inverse="true" cascade="all"
where=" TYPE='1' AND AI='1' " access="field">
<cache usage="read-write"
region="MainModel.Collection.ReadWrite" />
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ModificationProgramme" />
</bag>
</component>

<component name="imputationEcartAi"
class="com.rte.emma.communs.modeles.pojos.RgptImputationEcartAi">

<parent name="entitePce" />

<bag name="airCauses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '57' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>
<bag name="aicCauses" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '58' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>
<bag name="aiCommentaires" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '60' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>
</component>

<component name="imputationEcartJournalierJ"
class="com.rte.emma.communs.modeles.pojos.RgptImputationEcartJournalier">

<parent name="entitePce" />

<bag name="causes" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '56' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>
<bag name="commentaires" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '59' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>

</component>

<component name="imputationEcartJournalierJPlus1"
class="com.rte.emma.communs.modeles.pojos.RgptImputationEcartJournalier">

<parent name="entitePce" />

<bag name="causes" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '56' and JOUR='1' " access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>
<bag name="commentaires" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '59' and JOUR='1' " access="field">

<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ImputationEcart" />
</bag>

</component>

<component name="programmeEntiteAjustableAi"
class="com.rte.emma.communs.modeles.pojos.ProgrammeEntiteAjustableAi">

<parent name="entitePce" />

<bag name="pmAvantAics" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '46' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmAvantAirs" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '47' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paAvantAirs" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '44' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>

</component>

<component name="programmeEntiteJ"
class="com.rte.emma.communs.modeles.pojos.ProgrammeEntite">

<parent name="entitePce" />

<bag name="paInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '43' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRpInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '48' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRsInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '49' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmRpInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '157' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmRsInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '158' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paHorsFortuits" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '50' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paCourants" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '43' and COURANT='1' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRpCourants" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '48' and COURANT='1' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRsCourants" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '49' and COURANT='1' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '45' and COURANT='0' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmCourants" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '45' and COURANT='1' and JOUR='0' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmSimules" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '52' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>

<bag name="pmSimuleFatals" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '53' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>

<bag name="paSimules" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '51' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>

<bag name="ecartAleasJs" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '54' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="ecartAleasJPlus1s" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '54' and JOUR='0' " access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>

</component>

<component name="programmeEntiteJPlus1"
class="com.rte.emma.communs.modeles.pojos.ProgrammeEntite">

<parent name="entitePce" />

<bag name="paInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '43' and COURANT='0' and JOUR='1' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRpInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '48' and COURANT='0' and JOUR='1' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="paRsInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '49' and COURANT='0' and JOUR='1' "
access="field">
<key on-delete="cascade">
<column name="IDENTITE" precision="22" scale="0"
not-null="true" />
</key>
<one-to-many
class="com.rte.emma.communs.modeles.pojos.ChroniqueProgramme" />
</bag>
<bag name="pmRpInitials" inverse="true" cascade="all"
where=" IDTYPECHRONIQUE = '157' and COURANT='0' and JOUR='1' "
access="field">
<key on-delete="cascade">


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2008 2:02 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Two things:

I don't see where you are declaring that that class is to be cached.
(Maybe you have this configured somewhere else) I normally do it on the mapping file like this:

Code:
   <class name="com.test.Parent"  table=...
          <cache usage="read-only"/>



Also, since your class has so many bags attached to it, notice that collections have to be declared independently in your cache file.
This is a little piece of information that no one bothers to tell you.
For example, if you have a Parent with Child elements, don't do this in your ehcache.xml file:

Code:
    <cache name="com.test.Parent" maxElementsInMemory=...
           
    <cache name="com.test.Child" maxElementsInMemory=...


.. but this ...

Code:
    <cache name="com.test.Parent" maxElementsInMemory=...
           
    <cache name="com.test.Parent.children" maxElementsInMemory=...


Weird, isn't it? You cache the Child class, but the dependent collection from the Parent object.

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 06, 2008 4:13 am 
Newbie

Joined: Sat Apr 29, 2006 9:52 am
Posts: 8
Thanks gonzao_diaz for your reply.

1/ cache declarations/regions are in an other file (I didn't want to do a too big post)
2/ Actually "the bags not in cache" thing was done on purpose. But you gave me an idea, so I commented the bags and everything went back to normal. So I think I'm going to find an other way to access this bags.

Actually I don't understand how Hibernate works with query caches, when it stores the collection Pojo with bags in.

thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.