Hi, I am trying to drill down the double-insert into
RAG_GROUP_SUBSCRIPTIONS in 3.1 RC1
I really need some help understanding how this works.
I dont think it is a Oracle Problem. Looking further into the sourcecode I
find
POJO PlanetSubscriptionData :
/**
* @hibernate.set table="rag_group_subscription" lazy="true"
cascade="save-update"
* @hibernate.collection-key column="subscription_id"
* @hibernate.collection-many-to-many column="group_id"
class="org.apache.roller.planet.pojos.PlanetGroupData"
*/
POJO PlanetGroupData :
/**
* @hibernate.set table="rag_group_subscription" lazy="true"
invert="true" cascade="save-update"
* @hibernate.collection-key column="group_id"
* @hibernate.collection-many-to-many column="subscription_id"
class="org.apache.roller.planet.pojos.PlanetSubscriptionData"
*/
Fact : I created a uniqe constraint across both colums and it is
triggered every time I try to add a new feed (standalone or in group).
Thats what is happening without constraint :
Hibernate: insert into rag_subscription (feed_url, last_updated, site_url,
title, author, inbound_links, inbound_blogs, id) values (?, ?, ?, ?, ?, ?,
?, ?)
Hibernate: insert into rag_group_subscription (group_id, subscription_id)
values (?, ?)
Hibernate: insert into rag_group_subscription (subscription_id, group_id)
values (?, ?)
where an identical entry is created (i.e. parameters AND values are
switched in the query)
I worked on how things are done here using the XDoclet parameters , but I
am far from fully understanding how this works - and I dont think I want
to learn Hibernate :-(
You are trying to fill the rag_group_subscription table by updating it if
rag_subscription or rag_group is updated(inserted).
My 2 cent on it :
You are defining
@hibernate.collection-many-to-many column="group_id"
@hibernate.collection-many-to-many column="subscription_id"
why do you think this are many-to-many columns ?
Does cascade="save-update" delete entries from the table if a group is
delted ?
- have a nice weekend
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Thomas Hofmann
--
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorized
copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.