-->
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.  [ 5 posts ] 
Author Message
 Post subject: subselect returning stale results
PostPosted: Thu Mar 09, 2006 9:32 pm 
Newbie

Joined: Tue Jun 07, 2005 10:45 pm
Posts: 15
Location: Sydney
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,


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 12, 2006 6:30 pm 
Newbie

Joined: Tue Jun 07, 2005 10:45 pm
Posts: 15
Location: Sydney
...or to put it another way, does subselect work in 3.1.2?

The <synchronize> won't work for me.

If I have a mapping based on table A, and another mapping that uses a subselect which references table A, then I'm expecting that updating a row in A would evict any objects from the mapping with the subselect which references table A.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 1:48 am 
Newbie

Joined: Tue Jun 07, 2005 10:45 pm
Posts: 15
Location: Sydney
...ok, still no response from anyone.

can anyone at least tell me simply if i'm doing something stupid?

am i missing some basic idea about what the <synchronize> tag is supposed to do?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 12:44 am 
Newbie

Joined: Tue Jun 07, 2005 10:45 pm
Posts: 15
Location: Sydney
Reported as bug.

http://opensource2.atlassian.com/projec ... e/HHH-1568


Top
 Profile  
 
 Post subject: Re: subselect returning stale results
PostPosted: Tue Jun 12, 2012 1:13 am 
Newbie

Joined: Thu Nov 10, 2005 6:05 am
Posts: 16
Hi Greg, I know it's a very old topic, but have you found any solution for this problem?

(I've read the related bug report and you're right, either the Hibernate doc is wrong or this is a bug.)

Ivan


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