Hi
I have three entities
Computer - 1 : n - ComputerAssociation - n : 1 - User
The collections on both Computer and User are marked with inverse = true.
However, when I try to delete a ComputerAssociation, it fails with a
NHibernate.ObjectDeletedException:deleted object would be re-saved by
cascade (remove deleted object from associations)
I thought inverse were just for that: Changes are not reflected to the
database.
My mappings:
Computer:
[HasMany(
typeof(ComputerAssociation),
Cascade = ManyRelationCascadeEnum.AllDeleteOrphan,
Inverse = true,
Lazy = true)
]
public virtual IList<ComputerAssociation> Users{get;set;}
ComputerAssociation:
[BelongsTo(NotNull = true, Cascade = CascadeEnum.SaveUpdate)]
public Computer Computer {get;set;}
[BelongsTo("aduser", NotNull = true, Cascade = CascadeEnum.SaveUpdate)]
public User User {get;set;}
User:
[HasMany(
typeof(ComputerAssociation),
Lazy=true,
Cascade = ManyRelationCascadeEnum.AllDeleteOrphan,
Inverse = true)]
public virtual IList<ComputerAssociation> Computers {get; set;}
I also changed the Cascade on the n:1 side to CascadeEnum.All, but then I
get an even stranger exception:
NHibernate.HibernateException : Flush during cascade is dangerous
???
TIA
-Markus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---