Occassional problem with "Could not initialize proxy - no Session"

539 views
Skip to first unread message

Eleasar

unread,
Mar 17, 2010, 4:58:31 AM3/17/10
to sharp-arc...@googlegroups.com

Hi,

 

first of: big thx for creating and maintaining S#arp Project – it is really a great architecture and making development much faster and robust and…

 

Now to my question :-)

 

From time to time after some real database exceptions occurred (timeouts – underlying code will be fixed soon) the NHibernate part gets into an unstable state. The NHibernate writes over minutes the following type of error:

 

<date-time> [36] ERROR NHibernate.LazyInitializationException [(null)] - Initializing[<my project name>.Core.<my domain class>#23]-Could not initialize proxy - no Session.

NHibernate.LazyInitializationException: Initializing[<my project name>.Core.<my domain class>#23]-Could not initialize proxy - no Session.

 

It is normally working all just fine, system is running for days and under load and so. But sometimes (specially after some database exception occurred) it just gets instable and does not recover over the course of many requests over many minutes. IIS Reset “fixes” it.

 

Can you give tipps on where I should look into/what are likely causes for this? What I can do to maybe enforce an NHibernate reset or whatever?

 

I am using the S#arp Architecture version 1.0.0 btw.

 

Thx in advance!

 

 

 

Eleasar

unread,
Mar 17, 2010, 12:07:30 PM3/17/10
to S#arp Architecture
Forgot the add the following info. The first NHibernate questino after
which the above mentioned exceptions occure:

date [20] ERROR NHibernate.Util.ADOExceptionReporter
NHibernate.Util.ADOExceptionReporter.LogExceptions(:0) - There was a
problem converting an IDataReader to NDataReader
date [20] ERROR NHibernate.Util.ADOExceptionReporter
NHibernate.Util.ADOExceptionReporter.LogExceptions(:0) - Invalid
attempt to call FieldCount when reader is closed.
date [20] ERROR project.Web.MvcApplication
project.Web.MvcApplication.Application_Error(:0) - uncought exception
for URL ...

System.InvalidOperationException: Invalid attempt to call FieldCount
when reader is closed.
at System.Data.SqlClient.SqlDataReader.get_FieldCount()
at NHibernate.Driver.NDataReader.NResult..ctor(IDataReader reader,
Boolean isMidstream)
at NHibernate.Driver.NDataReader..ctor(IDataReader reader, Boolean
isMidstream)

Андрей Кожин

unread,
Mar 23, 2010, 9:02:30 AM3/23/10
to sharp-arc...@googlegroups.com


2010/3/17 Eleasar <ele...@gmx.li>

--
You received this message because you are subscribed to the Google Groups "S#arp Architecture" group.
To post to this group, send email to sharp-arc...@googlegroups.com.
To unsubscribe from this group, send email to sharp-architect...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sharp-architecture?hl=en.


Eleasar

unread,
Mar 23, 2010, 9:31:06 AM3/23/10
to S#arp Architecture
Hm - not sure if this was a reply - if yes then thanks :) - but i
can't see any text.

But in general: this problem still exists and i can't track it down.

Can it be around transactions in controller methods and lazy loading
in the view or such?

Any hints would be appriciated!

Thx

On Mar 23, 2:02 pm, Андрей Кожин <hed...@gmail.com> wrote:
> 2010/3/17 Eleasar <elea...@gmx.li>

> > sharp-architect...@googlegroups.com<sharp-architecture%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages