Hi, I dumped the SaveEventListener because it was as bad as the first version of my attempt. while changing stuff in the SaveEventListener, and being very sure to not change any essentials of the return values, It's having strange effects on my updates in the database.
the IPostInsertEventListener, IPreInsertEventListener, IPostUpdateEventListener, IPreUpdateEventListener were doing the trick for me.. On 12 mei, 08:56, Peter Derwa <[email protected]> wrote: > More info on what I'm doing within the > customSaveOrUpdateEventListener: > I'm doing a session.Get() on the same object to get the old version of > that object, and save them to a changelog object. > so first I do a get, I place all values of the previous state of that > object into a changelog object, > then I evict that previous state and do a performSaveOrUpdate. > > on the Session.SaveOrUpdate() (before the eventlistener is triggered) > I'm using a transaction. > > On 10 mei, 14:50,PeterDerwa<[email protected]> wrote: > > > > > Hi, > > > I'm having a problem with a BAG collection of one to many related > > objects. > > I'm useing a custom save eventlistener to check the data before it's > > actually going to the database, > > so right before the base.PerformSaveOrUpdate() I'm creating changelogs > > if necessary. > > > However, now my object in the one to many collection isn't saving > > anymore... > > > let's say i have an invoice with OrderItem bag (one to many). > > when i would save a new order item (through the invoice) I would be > > able to do so, but when i would change the product in the order item, > > or the quantity, it isn't changed, while it is really passing through > > the PerformSaveOrUpdate() Method, but it's just not saving!! > > > here are the logs (TestdataKba is the type in the one to many > > collection ) > > starting from the point of where the Testdatakba (order item) is > > hitting the base.PerformSaveOrUpdate(event); > > > 2010-05-10 14:17:02,448 [14] DEBUG NHibernate.Engine.VersionValue - > > unsaved-value: 0 > > 2010-05-10 14:17:02,448 [14] DEBUG > > NHibernate.Event.Default.AbstractSaveEventListener - detached instance > > of: ET.Deap.Common.Model.TestDataKba > > 2010-05-10 14:17:02,448 [14] DEBUG > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating > > detached instance > > 2010-05-10 14:17:02,448 [14] DEBUG > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating > > [ET.Deap.Common.Model.TestDataKba#7241] > > 2010-05-10 14:17:02,448 [14] DEBUG > > NHibernate.Event.Default.DefaultSaveOrUpdateEventListener - updating > > [ET.Deap.Common.Model.TestDataKba#7241] > > > why isn't this saving? I'm clearly seeing the entity going as a > > changed object to the saveOrUpdate Method.. > > > -- > > 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 > > athttp://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 > athttp://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.
