-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem removing objects from a collection
PostPosted: Tue Sep 19, 2006 9:16 am 
Newbie

Joined: Wed Jan 11, 2006 10:28 am
Posts: 19
Location: Fano, Italy
Hibernate version:
3.1.3

Name and version of the database you are using:
HSQLDB 1.8.1

I have a complex class with some collections of complex child objects and some collections of simple objects... like this
public class Data
{
...

public List<MD_ApplicationSchemaInformation> getApplicationSchemaInfo()
{
...
return applicationSchemaInfo;
}
public List<String> getHierarchyLevelName()
{
return hierarchyLevelName;
}
...
}

mapped like this:
<idbag name="applicationSchemaInfo" lazy="true" cascade="save-update" table="MDT_APPSCHEMAINFOS">
<collection-id type="long" column="MDT_APPSCHEMAINFOS_ID">
<generator class="sequence" />
</collection-id>
<key column="APPSCHEMAINFO_ID" />
<many-to-many class="it.terranova.metadata.iso19115.applicationschema.MD_ApplicationSchemaInformation"
column="applicationSchemaInfo" />

</idbag>
<idbag name="hierarchyLevelName" lazy="true" cascade="save-update" table="MDT_HLEVELNAMES">
<collection-id type="long" column="MDT_HLEVELNAMES_ID">
<generator class="sequence" />
</collection-id>
<key column="HLEVELNAME_ID" />
<element type="string" column="hierarchyLevelName" not-null="true" />
</idbag>

the problem is that when i try to remove a complex object from a collection (getCollection().remove(object)) all works correctly, but when i try to remove a simple object (like strings) i need to call the getCollection().remove(object) twice for obtain the correct result.

I have disabled the cache but the result is the same.
<!-- Use the C3P0 connection pool. -->
<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">20</property>
<property name="c3p0.timeout">300</property>
<property name="c3p0.max_statements">50</property>
<property name="c3p0.idle_test_period">3000</property>

<!-- Disable second-level cache. -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>
<property name="max_fetch_depth">3</property>

Any suggestion?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 10:56 am 
Newbie

Joined: Wed Jan 11, 2006 10:28 am
Posts: 19
Location: Fano, Italy
Sorry but i have found a bug in my code, this problem is not due to hibernate, so sorry for the time spent reading this not useful post :(


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

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.