Visual Basic .NET » ASP.NET General Discussion
AjaxPro and NHibernate Problems -- Jon Ceanfaglione --

Joseph mentioned he was having problems with NHibernate and AjaxPro, so I decided to do some testing with NHibernate. I created a sinple method that would load an object (Account) that had an IList of other objects (User)
using NHbernate. I wrote a test and ran it in nunit and is passed,
NHibernate creates the Account object and I can see that I have an IList that is populated with 5 User objects. So, I go ahead and create the AjaxPro Method and create an ASPX page to run the ajax and inspect with fiddler. Here is where the fun begins. The page runs, but it crashes the webserver. So back to the drawing board, I expand my test to include:

string s = AjaxPro.JavaScriptSerializer.Serialize(o);
Assert.IsTrue(s.Length > 0);

Now it crashes the NUnit text console. I would be willing to say that there are problems with objects created by NHibernate and AjaxPro. I will do some further testing and update you all.

r/Jon

-- Jon Ceanfaglione --

UPDATE...

Ok, I first thought the problem might be that .NET couldn't serialize the object correctly and thus AjaxPro was having issues. b/c once nhibernate creates the object that should be it, no interference with AjaxPro - doesn;t make sense that NHibernate would cause a problem.

So, I created a simple web service to return the object, and no that was not the issue. .NET returned the correct XML representation. So, I have used a
*simpler* object that has no IList implementation, or nested object - and VOILA, AjaxPro can serialize to JSON. So, I will do some more investigation and see what I come up with.

On 7/7/06, Jon Ceanfaglione wrote:

Joseph mentioned he was having problems with NHibernate and AjaxPro, so I
decided to do some testing with NHibernate. I created a sinple method that
would load an object (Account) that had an IList of other objects (User)
using NHbernate. I wrote a test and ran it in nunit and is passed,
NHibernate creates the Account object and I can see that I have an IList
that is populated with 5 User objects. So, I go ahead and create the
AjaxPro Method and create an ASPX page to run the ajax and inspect with
fiddler. Here is where the fun begins. The page runs, but it crashes the
webserver. So back to the drawing board, I expand my test to include:

string s = AjaxPro.JavaScriptSerializer.Serialize(o);
Assert.IsTrue(s.Length > 0);

Now it crashes the NUnit text console. I would be willing to say that
there are problems with objects created by NHibernate and AjaxPro. I will
do some further testing and update you all.

r/Jon


 

[Submit Comment]Home