Java Mailing List Archive

http://www.gg3721.com/

Home » the NHibernate development list »

[NHibernate-development] PostInsertEvent, PostUpdateEvent,
 PostDeleteEvent

Will Shaver

2008-03-20


Author LoginPost Reply
I was exploring the event architecture to see if it would work for me when I found something that might be a bug... but it might also be by design so I'm posting it here.
 
The code for the EntityIdentityInsertAction / EntityUpdateAction / EntityDelete action appears to function in this method for the Execution of the actual action:
 
Execute()
{
  bool veto = PreAction(); //where Action is Insert/Update/Delete
 
  if(!veto)
    PerformTheActualAction();
 
 //other function calls ommitted for brevity
 
  PostAction();
}
 
 
This means that even if the PreAction() approves a veto the PostAction will still be called.
 
It seems to me that these should only be called if the action isn't vetoed -- if the action actually happens. But perhaps there's a good reason for them to always be called that I can't think of.
 
 -Will
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
©2008 gg3721.com - Jax Systems, LLC, U.S.A.