I've got an ASP MVC application where I am editing a field and posting the change back via Javascript like so:
"saveAndClose": function () {
var url = baseURL + "Product/UpdateProductFamily/" + $.trim($('#Id').text()) + "/" + $('#recordValue').val();
$.get(
url,
function (returnedData) {
alert('worked');
});
The call doesn't even make it to the controller, instead I get an exception in the NHibernate Session manager:
private static void BeginTransaction(object sender, EventArgs e)
{
var x = NHibernateSessionManager.Instance;
x.BeginTransaction();
Thread.CurrentThread.Name = x.GetSession().GetSessionImplementation().SessionId.ToString();
}
The x.GetSession() line errors saying "The property is already set and cannot be modified".
What's going on here? Why is a simple JQuery get to the controller causing this NHibernate error?