-->
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.  [ 1 post ] 
Author Message
 Post subject: Delete event with null entity
PostPosted: Sat Mar 29, 2008 1:48 am 
Newbie

Joined: Fri Feb 15, 2008 5:07 am
Posts: 13
Hi, I have an application working with mysql and hibernate/spring, and in one constraint in the database I have defined in the following key

Table Location
.
.
FOREIGN KEY(POWER_METER_ID_POWER_METER)
REFERENCES POWER_METER(ID_POWER_METER)
ON DELETE SET NULL
ON UPDATE NO ACTION

The problem is when I delete a row from PowerMeter table, any idea? It's a bug? or what should I do?, I have configured other tables wih DELETE CASCADE and it works fine, you can see the exception below.

Regards,

gishac
dvP

Hibernate version:
3.2
Mapping documents:

PowerMeter
-----------------------------------------------
.
.

<set name="locations" inverse="true" cascade="delete">
<key>
<column name="POWER_METER_ID_POWER_METER" not-null="true" />
</key>
<one-to-many class="sicce.api.info.Location" />
</set>
.
.
----------------------------------------------


Full stack trace of any exception that occurs:

java.lang.IllegalArgumentException: attempt to create delete event with null entity
at org.hibernate.event.DeleteEvent.<init>(DeleteEvent.java:24)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744)

at org.springframework.orm.hibernate3.HibernateTemplate$25.doInHibernate(HibernateTemplate.java:790)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
at org.springframework.orm.hibernate3.HibernateTemplate.delete(HibernateTemplate.java:784)
at org.springframework.orm.hibernate3.HibernateTemplate.delete(HibernateTemplate.java:780)
at sicce.api.dataaccess.PowerMeterDAO.delete(PowerMeterDAO.java:58)
at sicce.api.dataaccess.PowerMeterDB.Delete(PowerMeterDB.java:34)
at sicce.ui.manager.forms.PowerMeterPane.Delete(PowerMeterPane.java:219)
.
.
.


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

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.