All work
- Bubble LifecycleVeto up from dependent collectionsNH-1021Resolved issue: NH-1021
- generator class="native" doesn't work with NHibernate.Driver.SqlServerCeDriverNH-984Resolved issue: NH-984
- SaveOrUpdateCopy fails with unsaved transient instance with bags that are lazily loadedNH-983Resolved issue: NH-983
- OnPreLoad & OnPostLoad Lifecycle EventsNH-970Resolved issue: NH-970
- User defined generic bagNH-968Resolved issue: NH-968
- Unsafe type cast code in DetachedCriteria.GetExecutableCriteriaNH-966Resolved issue: NH-966
- Error with computed property (property ... formula="... ) inside <compsite-element> blockNH-965Resolved issue: NH-965
- Evict does not cancel the sql statements on the entityNH-964Resolved issue: NH-964
- Allow indices to be created on bagsNH-963Resolved issue: NH-963
- Parent-Child relationships not properly persisted in certain casesNH-962Resolved issue: NH-962
- Error with computed property (property ... formula="... ) inside <component> blockNH-961Resolved issue: NH-961
- HQL queries with math operators and aggregates failNH-959Resolved issue: NH-959
- ISession.SaveOrUpdateCopy throws exception when class has <any> mappingNH-958Resolved issue: NH-958
- Allow setting access strategy for 'parent' propertyNH-957Resolved issue: NH-957
- one-to-one does not work correctly on table per subclassNH-956Resolved issue: NH-956
- Fix build for mono-1.0 on LinuxNH-954Resolved issue: NH-954
- AddAssembly doesn't seem to order joined-subclass correctlyNH-952Resolved issue: NH-952
- Nullables, NUnit for Caches.MemCacheNH-951Resolved issue: NH-951
- Criteria with order by cannot be used with projectionNH-949Resolved issue: NH-949
- Documentation needs update: "Copy the xsd files to ... directory for enabling IntelliSense"NH-948Resolved issue: NH-948
- Add IInterceptor.SetSessionNH-947Resolved issue: NH-947OrenE
- Wrong default values creating a class mapping dynamicallyNH-945Resolved issue: NH-945
- Provide API for specifying JoinType in subqueriesNH-944Resolved issue: NH-944
- Ignored class arbitrary sql where conditionNH-942Resolved issue: NH-942
- domain model exception badly handled by proxy NHibernateNH-940Resolved issue: NH-940
- ISet with order-byNH-939Resolved issue: NH-939
- Improve comments and parameter listsNH-937Resolved issue: NH-937
- Fix Spelling in comments and parameter listsNH-934Resolved issue: NH-934
- Expression.In does not support Generic listsNH-933Resolved issue: NH-933
- Error Message Improvement for SingleTableEntityPersister.csNH-931Resolved issue: NH-931
- Schema Export generates duplicate constraintsNH-930Resolved issue: NH-930
- session.Save(object) sets bogus ID fields using MySQL with default hibernate.connection.release_modeNH-929Resolved issue: NH-929
- Add equivalent to "select entity" to criteria APINH-928Resolved issue: NH-928
- Parameters in Order By Clause don't workNH-927Resolved issue: NH-927
- Identity insert fails with SQL Ce dialect and aggressive connection release mode.NH-926Resolved issue: NH-926
- Support loading many-to-many collections by custom SQLNH-925
- <many-to-one> associated by property-ref generates wrong SQLNH-892Resolved issue: NH-892Richard Brown
37 of 37
Bubble LifecycleVeto up from dependent collections
Won't Fix
Description
Environment
None
Created May 29, 2007 at 1:44 PM
Updated June 30, 2008 at 6:59 AM
Resolved May 29, 2007 at 10:33 PM
Activity
Former user May 29, 2007 at 10:33 PM
Former user
May 29, 2007 at 10:33 PM
There won't be any enhancements to ILifecycle in the future. Use an interceptor or create a method to check for this condition manually before actually deleting the entity.
(Carried over from forum post http://forum.hibernate.org/viewtopic.php?p=2345556#2345556. Also I don't know whether this is better posted to the Hibernate side)
I am using ILifecycle under NHibernate 1.2.0 CR1 and hitting a limitation of the LifecycleVeto for OnDelete. I have an entity with a child collection that is configured for cascade="all-delete-orphan". If I delete the top most object, the whole object graph is deleted from the database which is great. If I have logic in ILifecycle.OnDelete for the top object and return a LifecycleVeto.Veto, then the whole deletion is canceled as I would hope. However, if it is one of the child objects that returns the Veto in its own ILifecycle.OnDelete, NHibernate still tries to persist the deletion of the parent (and other children). In my case, an exception subsequently results from the violation of a database foreign key constraint.
I would guess this is "functions as designed", but I figured I would see if anyone has any creative solutions to this other than just checking all child objects from the parent's OnDelete?
It seems like it would be a nice enhancement to ripple a child's Veto up the dependent collection chain. Although, I would imagine there would need to be some clear restrictions (e.g. a one to many relationship with cascade...) or have this be configurable in some way.
Another workaround would be to throw a CallbackException in the child's OnDelete, but that doesn't feel right for a "normal" execution flow. In my case, I am trying to not delete this object graph if some outside entity has a many-to-many association into one of the child objects.