Hello,
I have this awkward problem that randomly wrong entity is attached to the entity. Here are the somewhat changed (names) mapping files:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-access="field">
<class name="com.coolwebsite.Plan" schema="PLAN" table="PLAN">
<id name="id" column="ID" unsaved-value="0">
<generator class="sequence">
<param name="sequence">PLAN.PLAN_ID_SEQ</param>
</generator>
</id>
<many-to-one name="party" column="PARTY_ID" class="com.coolwebsite.Party" cascade="save-update,persist"/>
<set name="relatedParties" schema="PLAN" table="RELATED_PARTIES" sort="natural" cascade="all,delete-orphan" fetch="subselect">
<key column="ID"/>
<many-to-many column="PARTY_ID" class="com.coolwebsite.Party"/>
</set>
[...]
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-access="field">
<class name="com.coolwebsite.Party" schema="PLAN" table="PARTY" batch-size="20">
<id name="id" column="PARTY_ID" unsaved-value="0">
<generator
class="sequence">
<param name="sequence">PLAN.PARTY_ID_SEQ</param>
</generator>
</id>
[...]
</class>
</hibernate-mapping>
Sometimes wrong Party is attached to Plan.party. These are used in a web application and after refresh it corrects itself. I haven't found a concrete pattern of when this bug appears, it only appears on some Plans.
Using Hibernate 3.3.1.GA with Oracle DBMS.
Anyone has had these kind of problems? Or which further information I could provide?
Thanks.