Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.0.1.4
Mapping documents:
<class name="FlexiCommerce.Components.PersistenceItem,FlexiCommerce" table="FlexiItem">
<cache usage="read-write" />
<id name="ID" column="ID" type="Int32" unsaved-value="0" access="property">
<generator class="native" />
</id>
<discriminator column="Type" type="String" />
<property name="SortOrder" access="property" not-null="true" />
<many-to-one name="Parent" column="ParentID" class="FlexiCommerce.Components.PersistenceItem,FlexiCommerce" not-null="false" lazy="proxy" fetch="select" />
<bag name="Children" cascade="all" generic="true" inverse="true" order-by="SortOrder" lazy="true">
<cache usage="read-write" />
<key column="ParentID" />
<one-to-many class="FlexiCommerce.Components.PersistenceItem,FlexiCommerce"/>
</bag>
</class>
Problem
I delete an item and the database reflects it appropriately. The problem is when my treeview attempts to get the items children that contains the deleted item (which is cached). I get "No row with the given identifier exists". This is expected since I deleted them item the cached bag is trying to get.
It would hamper my performance greatly if I disable caching. Is there a way to suppress this exception and just remove that cached non-existent item from the bag?