-->
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.  [ 1 post ] 
Author Message
 Post subject: sets not refreshed even though cache is read-write
PostPosted: Wed Jan 05, 2005 2:01 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Hibernate version: 2.1.6

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="com.wachovia.evergreen.autorecon.bo">
<class name="Outage" table="var_outage">
<cache usage="read-only"/>

<id
column="var_outage_oid"
name="Id"
type="java.lang.Long"
>
<generator class="vm" />
</id>

<property
column="create_date"
length="23"
name="CreatedDate"
not-null="false"
type="timestamp"
/>

<many-to-one
class="DisputedHolding"
name="DisputedHolding"
not-null="true"
>
<column name="disputed_sec_holding_id" />
</many-to-one>
<many-to-one
class="HoldingParam"
name="HoldingParam"
not-null="true"
>
<column name="sec_holding_param_oid" />
</many-to-one>
<many-to-one
class="VarType"
name="VarTypeCode"
not-null="true"
>
<column name="var_type_code" />
</many-to-one>
<many-to-one
class="MeasuredParamType"
name="MeasuredParamType"
not-null="true"
>
<column name="measd_param_type_oid" />
</many-to-one>

<set name="Reasons" table="var_outage_rsn" cascade="all">
<cache usage="read-write"/>
<key column="var_outage_oid"/>
<many-to-many column="outage_rsn_oid" class="OutageReason"/>
</set>
</class>
</hibernate-mapping>

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="com.wachovia.evergreen.autorecon.bo">
<class name="OutageReason" table="outage_rsn">
<cache usage="read-write"/>
<id
column="outage_rsn_oid"
name="Id"
type="java.lang.Long"
>
<generator class="vm" />
</id>
<property
column="rsn_desc"
length="256"
name="Description"
not-null="false"
type="string"
/>
<property
column="create_date"
length="23"
name="CreatedDate"
not-null="false"
type="timestamp"
/>

<many-to-one
class="SpecificOutageProblem"
name="SpecificOutageProblem"
not-null="true"
>
<column name="specific_outage_prob_oid" />
</many-to-one>
<many-to-one
class="GenericOutageProblem"
name="GenericOutageProblem"
not-null="true"
>
<column name="generic_outage_prob_oid" />
</many-to-one>
<many-to-one
class="EndUser"
name="Creator"
not-null="true"
>
<column name="creator_analyst_id" />
</many-to-one>

<!-- set name="Outages" table="var_outage_rsn" cascade="all">
<cache usage="read-only"/>
<key column="outage_rsn_oid"/>
<many-to-many column="var_outage_oid" class="Outage"/>
</set -->
</class>

<query name="findOutagesByReason">
select vor.Outage
from VarOutageReason vor
where vor.OutageReason.Id = ?
</query>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
MS SQL Server 2000


I'm not experiencing an exception but more of a configuration error. I have an object with a non-lazy loaded set of children:
<set name="Reasons" table="var_outage_rsn" cascade="all">
<cache usage="read-write"/>
<key column="var_outage_oid"/>
<many-to-many column="outage_rsn_oid" class="OutageReason"/>
</set>

When I make a change to one of the children objects, the objects (as referenced from the set of the parent object) are still pulling from the stale cache even though I have assigned <cache usage="read-write"/> to the set. Am I doing something wrong? Any help would be greatly appreciated.

Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.