-->
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: StaleStateException ... <version> inconsistentencies
PostPosted: Wed Aug 09, 2006 9:18 am 
Newbie

Joined: Mon Jan 09, 2006 8:17 am
Posts: 19
hi,

I am getting the StaleStateException due to inconsistend version values in the tables.
When i commented out the <VERSION> tags, the error disappears.
What is happening is that the child subclasses, TB_VENDOR and TB_BUYER are not incrementing their version numbers in the respective tables while the TB_USER (the parent) is.

The inheritance structure is:
TB_BUYER extends TB_USER
TB_VENDOR extends TB_USER

Question: How can i add a <version> element for the <joined-subclasses> in the mapping file (snippet) show below ?

Thanks for helping.

Tony


Hibernate version: 3.1

Mapping documents:

<class name="TbUser" table="TB_USER">
<id name="id" type="integer" unsaved-value="0">
<column name="ID" />
<generator class="native" />
</id>
<!--
<version name="version"
column="VERSION" type="integer" unsaved-value="negative"/>
-->
..........
..........
<joined-subclass name="TbBuyer" table="TB_BUYER"
lazy="false">
<key column="id"/>
............
<property name="buyerNameC" type="string">
<column name="BUYER_NAME_C" length="50" />
</property>
............
<set name="tbBids" inverse="true" lazy="false" cascade="all" >
<key>
<column name="FK2_BID_ID" />
</key>
<one-to-many class="TbBid" />
</set>
<set name="tbBuyerInvoice" inverse="true" lazy="false" >
<key>
<column name="FK1_BUYER_INVOICE_ID" />
</key>
<one-to-many class="TbBuyerInvoice" />
</set>
</joined-subclass>
<joined-subclass name="TbVendor" table="TB_VENDOR"
lazy="false">
<key column="id"/>
<property name="vendorNameC" type="string">
<column name="VENDOR_NAME_C" length="50" />
</property>
.......
........
<set name="tbItems" inverse="true" lazy="false"
cascade="all"
order-by="LOT_NUM_C asc">
<key>
<column name="FK_ITEM_VENDOR_ID" />
</key>
<one-to-many class="TbItem" />
</set>
<set name="tbVendorInvoice" inverse="true" lazy="false">
<key>
<column name="FK1_VENDOR_INVOICE_ID" />
</key>
<one-to-many class="TbVendorInvoice" />
</set>
</joined-subclass>
</class>




Name and version of the database you are using:
MYSQL 4.1.10


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.