-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Web application doesn't come back after a server failure.
PostPosted: Wed Mar 21, 2007 2:35 am 
Newbie

Joined: Mon Nov 20, 2006 3:58 am
Posts: 12
We have developed a web application on nHibernate and MS SQL2000. the DB is on a remote server. The problem is if a DB server goes down the application crashes and even after the DB server come back live the application server remain crashed... and it doesn't automatically start.. and i have to redeploy the application server code to start it again.

Below is the error.

**************************************************************************
Server Error in '/' Application.

--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 2:48 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
And why do you think NHibernate is to blame?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 5:23 am 
Newbie

Joined: Mon Nov 20, 2006 3:58 am
Posts: 12
Sorry i failed to post the entire error stack.
here it is now
***********************************************************************************
Server Error in '/' Application.

--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
EDU.LUMS.OBS.DAL.DataLayer.rollback() in E:\MIM\Finale\Finale\EDU.LUMS.OBS.DAL\DataLayer.cs:127

[DALException: Unknown DataLayer Exception]
EDU.LUMS.OBS.DAL.DataLayer.rollback() in E:\MIM\Finale\Finale\EDU.LUMS.OBS.DAL\DataLayer.cs:142
EDU.LUMS.OBS.DAL.DataLayer..ctor() in E:\MIM\Finale\Finale\EDU.LUMS.OBS.DAL\DataLayer.cs:36
EDU.LUMS.OBS.DAL.ItemDAL..ctor() +4
EDU.LUMS.OBS.BL.ItemBL.getFeaturedItems() in E:\MIM\Finale\Finale\EDU.LUMS.OBS.BL\ItemBL.cs:389

[BLException: Featured Items could not been retrieved]
EDU.LUMS.OBS.BL.ItemBL.getFeaturedItems() in E:\MIM\Finale\Finale\EDU.LUMS.OBS.BL\ItemBL.cs:395
_Default.displayFeaturedItems() +65
_Default.Page_Load(Object sender, EventArgs e) +24
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

********************************************************************************

if u look at the stack the error is originating from the DAL. and when i run the same code from the VS2005 in debug mode i don't get any error. Even putting the backup of the code running make the site alive.. i feel that the nHibernate gets corrupted when the system crashes.. and it keeps giving the same error.

So is there any way i can debug this error.. just remember that running the code in the VS 2005.NET doesnot produce any error. so i need something which can pinpoint the error location when the code is running and crashes

Any help will be much appreciated


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 5:37 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Sorry but I don't see a single reference to NHibernate in the stack trace. Why do you think it's NHibernate getting corrupted and not your code? If NHibernate throws some kind of exception, please post it here (including inner exceptions and full stack trace) and somebody will help, but otherwise it looks like you expect people here to debug your application for you for free.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 7:13 am 
Newbie

Joined: Mon Nov 20, 2006 3:58 am
Posts: 12
sergey wrote:
Sorry but I don't see a single reference to NHibernate in the stack trace. Why do you think it's NHibernate getting corrupted and not your code? If NHibernate throws some kind of exception, please post it here (including inner exceptions and full stack trace) and somebody will help, but otherwise it looks like you expect people here to debug your application for you for free.


If you had seen the error stack and error was originating from the DAL, where the nHibernate is present. The reason is that even running the site for 48 hours in debug mode under the VS2005 does not crash it but it crash on the IIS hosting server. As we are not able to crash it in the debug mode therefore we have not been able to identify the root cause of it.

But the careful analysis of the code especially the DAL layer we feel that as the session.factory is a static object therefore one of the reason for the server not coming back live after the DB server failure is that the static session.factory state is saved when the DB server crashes and is not getting updated even after the DB server comes back live again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 6:46 am 
Newbie

Joined: Mon Nov 20, 2006 3:58 am
Posts: 12
I talked with the IIS guy today directly and he was kind enough to work with me over this issue. The problem is repeatable with following steps.

1. Click on Clothing, Shoes, and Accessories category of left hand side and let page load..
2. Click on Electornics and let page load.
3. Click on Sports & Outdoors and let page load.
4. Click on Automotive and let page load.
Repeat steps 1-4 until crash. It take around 10 iteration to crash the site.

I ran the CLR Profiler for the memory usage and also kept an eye on the worker process. The memory requirement never went above 180MB.. and the nothing unusal was found on CLR Profiler either.

The IIS guy point was that the nHibernate is not pooling the connections properly... will look into that matter now. i thought nHibernate auto manage all these things..

anyway just writing it down to provide a future reference for other people, maybe it will help few people. We have couple of possible fixes which we will try to implement and see how they do.. If i find a fix then i will write it here too.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 6:59 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
How are you managing sessions and transactions? NHibernate doesn't do its own connection pooling. Instead, it relies on the standard ADO.NET mechanism to pool connections.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 7:03 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Also, please post the stack trace that references NHibernate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.