Hi,
i found very particular case in which it looks that ehcache is not working
i am using hibernate 3.1.3
i have a many-to-many bidirectional association like this
User.hbm.xml
Code:
<set name="things" table="user_thing" cascade="save-update" sort="natural" lazy="true">
<cache usage="read-write"/>
<key column="id_user" />
<many-to-many class="xx.data.dto.Thing" column="id_thing" />
</set>
Thing.hbm.xml
Code:
<set name="users" table="user_thing" cascade="save-update" sort="natural" lazy="false" inverse="true">
<cache usage="read-write"/>
<key column="id_thing" />
<many-to-many class="xx.data.dto.User" column="id_user" />
</set>
i remove a Thing from a User with this User method
Code:
public void removeThing(Thing thing) {
things.remove(thing);
thing.getUsers().remove(this);
}
if i print the things set after the remove, it looks ok.
but if i access later the inverse side of the mapping (loading a Thing and getting aThing.getUsers()), the removed item is still there.
if i comment the cache on the inverse side, everything it works
Code:
<!--<cache usage="read-write"/>-->
it only happens with remove, many-to-many and on the inverse side.
any idea ?
Thanks