Blog Stats
  • Posts - 13
  • Articles - 0
  • Comments - 5
  • Trackbacks - 0

 

NHibernate in an an ajax application

OK, I'll admit I'm not the brightest light on the block.  I'm adding this post just in case some trys to do a Nhibernate save in an ajax call and wonders why it wasn't actually  saved.  Hopefully I won't be the only one who had this happen.  Also, in my defense this is the first time I've ever used NHibernate, so cut me a little slack.

So I set up NHibernate as most of the samples our there have it.  I've got an HttpModule that gets the Session object on BeginRequest from the cache and then calls Flush() and Close() on EndRequest.

Then I saving an object using an Ajax call, but it the record isn't saved.

Have you figured it out yet?  EndRequest is not called on the ajax call of course.  For now I'm calling Flush() directly after my save call.  I haven't decided whether or not to call Close() at this point yet.  Any sugestions?


Feedback

No comments posted yet.


Post a comment





 

 

 

 

Copyright © John Teague