I'm having the strangest issue... I have a monorail website (a .NET solution, similar to ASP.NET MVC).. and on one of the pages there is a save button. When the save button is clicked, it executes some code to save the object to the database, and then redirects to another page. However, what it does is immediately after you click the save button, it executes all of the save code, and then it sits there for a while, and then it redirects to the other page and executes its code. Here are some facts about the situation that make it especially strange.
So does anyone have any idea what would cause this? The save code uses Active Record and NHibernate. The code itself runs super fast, like I said it's less than 1ms, but it seems like there's something happening asynchronously AFTER the code finishes executing that makes it hang for a long time..
Any ideas would be greatly appreciated, the code is at http://pastebin.com/XGLAWPgK.
My Monorail is a bit rusty ...
Are you disposing of your ActiveRecord/nHibernate context after every request or caching it in the Session state? You shold create a new context for every request.
Are you Eager loading data entities? If you are Saving data, it may be fetching all associated entites.