Hi,
when i'm enable second level cache, i've a problem
2 entities :
abonnement
Code:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
default-cascade="none">
<class
name="...."
table="ABONNEMENT"
dynamic-insert="false"
dynamic-update="false"
lazy="true">
<cache usage="read-write" />
<id name="Id" type="Int64" unsaved-value="0">
<column name="ID" sql-type="BIGINT"/>
<generator class="native">
</generator>
</id>
........
<many-to-one name="Commande" class="Fr.Cned.AtoutCned.Dispositif.Entites.Collectivites.BonDeCommande, Fr.Cned.AtoutCned.Dispositif.Core" outer-join="auto" cascade="none" foreign-key="ABONNEMENT_COMMANDE_FKC">
<column name="COMMANDE_FK" not-null="false" sql-type="VARCHAR(255)"/>
</many-to-one>
.......
</class>
</hibernate-mapping>
bon de commande
Code:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
default-cascade="none">
<class
name="..."
table="BON_DE_COMMANDE"
dynamic-insert="false"
dynamic-update="false"
lazy="true">
<cache usage="read-write" />
<id name="Numero" type="String" unsaved-value="null">
<column name="NUMERO" sql-type="VARCHAR(255)"/>
<generator class="assigned">
</generator>
</id>
<set name="Abonnements" order-by="COMMANDE_FK" lazy="true" outer-join="auto" inverse="true" cascade="delete">
<cache usage="read-write" />
<key foreign-key="ABONNEMENT_COMMANDE_FKC">
<column name="COMMANDE_FK" sql-type="VARCHAR(255)"/>
</key>
<one-to-many class="Abonnement"/>
</set>
....
</class>
<!-- NHibernate.hbm.xml.vsl merge-point -->
</hibernate-mapping>
I define one object abonnement in bondecommande.
abo.commande = bondecommande
When i call bondecommande.commandes, it has not changed.
i had not this problem if second level cache is disable.
Why ?
Thanks Arno.