Hibernate version: 3.1.2
Mapping documents:
<hibernate-mapping auto-import="true" package="com.myco.ice.domain">
<class name="PersonSearch" batch-size="20">
<subselect>
select id_person , person_no , name_first , name_last
from PERSON
</subselect>
<cache usage="transactional"/>
<synchronize table="PERSON"/>
<id name="id" column="ID_PERSON" type="java.lang.Long"/>
<property name="personNo" column="PERSON_NO" type="java.lang.Integer"/>
<property name="firstName" column="NAME_FIRST" type="java.lang.String"/>
<property name="lastName" column="NAME_LAST" type="java.lang.String"/>
</class>
</hibernate-mapping>
Name and version of the database you are using: Oracle 10g, with JBoss TreeCache
The problem is that i'm expecting retrieval of PersonSearch to reflect the latest values in the PERSON table.
In the simple example above, only columns from the PERSON table appear in the PersonSearch mapping, whereas the planned use is to join multiple tables, etc, within the <subselect>
We do the following.
1. run query, using "from PersonSearch p where p.id > 100"
2. using id column from result set, load a Person
3. make change to Person and save
4. do 1. again, expecting changes made in 3. to appear in the PersonSearch result set -- but get same results as from 1.
If we manually evict the PersonSearch records for which the underlying Person record has changed, then we get what we expect in step 4. -- but the whole point of this is that we're expecting Hibernate to transparently evict any PersonSearch records that are stale.
Why aren't the PersonSearch records being evicted when Person is updated?
Thanks,
|