Hello,
I have one Problem...
- Resin 2.1.12 with mySQL and Oracle 8i. ( I was testing both )
Here is one of the mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="somepackage.group.model">
<class name="Group" table="contactGroup" discriminator-value="N">
<id name="id" column="Group_ID">
<generator class="native"/>
</id>
<version name="lastChange" type="timestamp"/>
<property name="name" not-null="true">
<column name="name" sql-type="varchar(50)" />
</property>
<property name="type" column="group_type" type="somepackage.group.model.GroupType" not-null="true"/>
<bag name="members" table="group_member" lazy="true" inverse="false">
<key column="GROUP_ID"/>
<many-to-many class="Contact" column="CONTACT_ID" />
</bag>
<many-to-one name="subscriber" column="Subscriber_ID" not-null="true"/>
</class>
</hibernate-mapping>
the contact has this bag-mapping
Code:
<bag name="groups" lazy="true" table="group_member" inverse="true">
<key column="CONTACT_ID"/>
<many-to-many class="Group" column="GROUP_ID"/>
</bag>
Everything is working fine, but after updating the contact and accessing the members of the group I get this Exception:
Code:
java.lang.NullPointerException
at net.sf.hibernate.collection.Bag.toString(Bag.java:483)
inside the logging statement.
The Update is done using a Transaction with commit.
When switching the Group to
Code:
lazy="false"
it is working fine...
Please help me :-(
Thanks.