hm strange. I'm not very familiar with deleting entire graphs as my project doesn't do deletes and it's my only experience with NH
------ Joe Brockhaus [email protected] ------------ On Mon, Jul 18, 2011 at 1:15 AM, Evgeniy The Best <[email protected]>wrote: > #Joe B > Yeap, but I've got somethg different situation.. Before this delete I > load all entities without proxy (lets assume I Iterate for every > object). > > If we look much closer on DeleteEntity method in > DefaultDeleteEventListener, we can see, that before actually push in > queue session.ActionQueue.AddAction(...), it calls > new ForeignKeys.Nullifier(entity, true, false, > session).NullifyTransientReferences(entityEntry.DeletedState, > propertyTypes); > new Nullability(session).CheckNullability(entityEntry.DeletedState, > persister, true); > > and here in persister object some attributes are set on, that's why > Ive got Not-null/trancient Exception > > > On 8 июл, 18:41, Joe B <[email protected]> wrote: > > oops. > > > > session.Load<PreviouslyNullPropertyEntityType>(..) > > > > On Jul 8, 8:39 am, Joe B <[email protected]> wrote: > > > > > > > > > if all you need to do is satisfy the error, you can use a Get/Load to > > > get a proxy of the entity if you know the ID. > > > > > yourEntity.PreviouslyNullProperty = > > > session.Load<YourEntityType>(yourEntity.PreviouslyNullPropertyID); > > > session.Delete(yourEntity); > > > > > as long as you don't access any properties of the > > > PreviouslyNullProperty, NH won't initiate a SELECT to the database. > > > > > seehttp:// > ayende.com/blog/3988/nhibernate-the-difference-between-get-loa... > > > > > On Jul 8, 2:36 am, Evgeniy The Best <[email protected]> wrote: > > > > > > It's my question fromhttp:// > stackoverflow.com/questions/6620554/nhibernate-exception-while... > > > > > > When I delete objectgraphand there are some one-way master (many-to- > > > > one) associations, NH throw error when found this not-null > association > > > > in DB, but didn't find master object in the session. > > > > > > How to make it work? > > > > mappings and scheme on stackoverflow- Hide quoted text - > > > > > - Show quoted text - > > -- > 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. > > -- 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.
