[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-05-11 Thread Scott Findlater
Fabio - there seem to be alot of cries for help but with no conclusive working examples; * https://groups.google.com/forum/#!topic/nhusers/0kugoXFPeGw/discussion - audit listener using IFlushEntityEventListener (continuation of NH-2596) *

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-05-11 Thread Fabio Maulo
Send me your little domain with a little explanation about how should work those 2 DateTime, then I'll write a public post using your domain. -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-05-11 Thread Filip Kinsky
you can use/fork my test case for NH-2596 here: https://github.com/Buthrakaur/NHListenerTests -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to nhusers@googlegroups.com. To unsubscribe from this group, send email to

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-05-11 Thread Filip Kinsky
fully working solution using IFlushEntityEventListener according to Fabio's suggestions: https://github.com/Buthrakaur/NHListenerTests/tree/ef59251c9af102381f13baf893e7c1dfb734dbeb -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-05-11 Thread Filip Kinsky
I managed to solve this problem using this IFlushEntityEventListener implementation: https://github.com/Buthrakaur/NHListenerTests/blob/master/NHListenerTest/SetModificationTimeFlushEntityEventListener.cs -- You received this message because you are subscribed to the Google Groups nhusers

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-27 Thread Scott Findlater
Hi, Fabio - thanks for your patience through this. Graham - thanks for your comments. I have written a NHForge WIKI article in the hope of documenting what I know -

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-10 Thread Fabio Maulo
Graham. In NH you can archive the same target in various ways. Your wiki (What I Know Is) is good enough to solve a problem in a way. but but a WIKI is a WIKI for example this WIKI shows various tech to do the same http://nhforge.org/wikis/howtonh/localization-techniques.aspx

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-09 Thread Scott Findlater
Fabio, I would like you to answer it is wrong or why it is ok, because on one hand you tell me do not change state in these events and on the other hand there are NH wiki posts changing state in these events. I am very confused as to what is correct? On Apr 8, 11:10 pm, Fabio Maulo

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-09 Thread Fabio Maulo
Try what I said and then prepare your article using WLW; then you can copypaste the HTML in nhforge wiki. On Sat, Apr 9, 2011 at 4:19 AM, Scott Findlater scottfindla...@gmail.comwrote: Fabio, I would like you to answer it is wrong or why it is ok, because on one hand you tell me do not change

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-09 Thread Graham Bunce
Scott, To jump in here. I wrote the article you referred to in your reply to Fabio, and tbh, I wouldn't consider it official NHibernate documentation. It was written a long time ago as an example of the things you could do with the events,when documentation on the interfaces as opposed to the old

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-09 Thread Graham Bunce
And just to clarify, this isn't a complaint at anyone. NH is a free product that is as good as anything else on the market, if not better, and it's worked on unpaid by the developers, so those of us who use it should be grateful for this and that NH is still an active product. On the flip side,

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Fabio Maulo
Scott, to change properties try to follow what I said and you will see that it is even more easy (you have to deal only with your object and not with NH internals). On Wed, Apr 6, 2011 at 4:42 AM, Scott Findlater scottfindla...@gmail.comwrote: Hi Suman, I would be interested to know if you

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Fabio, thank you so much for your reply. Sorry I do not think I am explaining myself very well, may I please ask you to download this sln (http://dl.dropbox.com/u/20651208/ WTF.zip) and I can demonstrate with just 3 tests in the BecauseOfEventHandling class; 1. Test

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Fabio, the sln link got truncated http://bit.ly/hBRgLv On Apr 8, 1:54 pm, Scott Findlater scottfindla...@gmail.com wrote: Fabio, thank you so much for your reply. Sorry I do not think I am explaining myself very well, may I please ask you to download this sln

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Fabio, thank you so much for your reply. Sorry I do not think I am explaining myself very well, may I please ask you to download this sln (http://dl.dropbox.com/u/20651208/WTF.zip) and I can demonstrate with just 3 tests in the BecauseOfEventHandling class; 1. Test

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Fabio Maulo
Scott, PreUpdate, PreInsert, PreDelete are to check entity state (as most even to log) but NOT TO CHANGE entity state. Again, try to follow what I said. To Log the old state or the difference you can use even the PostXYZ. On Fri, Apr 8, 2011 at 9:54 AM, Scott Findlater

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Hi Fabio, OK, obviously you are right :) I will stop trying to change entity state in these events. It is just NOT TO CHANGE state in these events is not really documented anywhere and from blog posts give examples of using the OnPreInsert and OnPreUpdate event listeners as the perfect place for

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Fabio Maulo
is not really documented anywhere That is only because we are still waiting your patch for the NHibernate public documentation. If you don't want to send a patch you can use the nhforge wiki, the knol ( http://knol.google.com), share your experience in your blog, share your experience in the

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Touche Fabio :) I will make a deal with you ... I will write an in depth documentation patch about the NH event model if you can please explain why there is wiki article explaining how to create an audit log which clearly uses the OnPre events to CHANGE ENTITY state -

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Scott Findlater
Touche Fabio :) I will happily contribute to the documentation but how do I explain a contradiction in the official NHibernate wiki article which uses the OnPre events TO CHANGE STATE - http://nhforge.org/wikis/howtonh/creating-an-audit-log-using-nhibernate-events.aspx On Apr 8, 7:33 pm, Fabio

Re: [nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-08 Thread Fabio Maulo
I asked you to write a wiki, right ? well... imagine that you do it and after some moths somebody else will ask me why that wiki say those things ? what should I answer ? On Fri, Apr 8, 2011 at 5:34 PM, Scott Findlater scottfindla...@gmail.comwrote: Touche Fabio :) I will make a deal with you

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-07 Thread Suman
In my case, There is always some update on subclass. I haven't tested it the exact scenario that you've mentioned but yeah seems like it's still an issue. On Apr 6, 5:42 pm, Scott Findlater scottfindla...@gmail.com wrote: Hi Suman, I would be interested to know if you are updating any other

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-06 Thread Suman
Hi Scott, I have similar issue and I was about to ask the same question here. Further to your situation, I am not sure whether it's a bug or feature, In my mapping, when I have dynamic-update = true in subclass the audit columns in base class, the generated sql doesn't include audited column

[nhusers] Re: Clarification on NH-2596 of PreUpdate vs OnSaveOrUpdate semantics

2011-04-06 Thread Scott Findlater
Hi Suman, I would be interested to know if you are updating any other properties in your subclass, that after removing dynamic-update=true, all works. This is because if I update a property on the subclass then any processing in the PreUpdate event is persisted, but if the subclass is only