I am having an unusual issue with NHibernate. I am using NHibernate
2.1 with WCF and SQL Server, and using both mapped entities and stored
procedures. Three times in the past week, NHibernate has gotten into a
state where it throws IndexOutOfRangeExceptions for table columns and
stored procedure result columns that are correctly mapped. This occurs
for several minutes, and then appears to resolve itself. I can't
figure out how or why this could occur.

The issues start with a "Session is Closed!" error, which has occurred
on the same stored procedure call all three times:

[ exec SERVICING.GET_CHAT_MESSAGES_BY_QUEUE_ID ? ]
  Name:QUEUE_ID - Value:f85ba08e-74ee-4e77-b242-9d890103e02d
[SQL: exec SERVICING.GET_CHAT_MESSAGES_BY_QUEUE_ID ?] --->
System.ObjectDisposedException: Session is closed!
Object name: 'ISession'.
   at NHibernate.Impl.AbstractSessionImpl.ErrorIfClosed()
   at
NHibernate.Impl.AbstractSessionImpl.CheckAndUpdateSessionStatus()
   at NHibernate.Impl.StatelessSessionImpl.get_Batcher()
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
QueryParameters queryParameters, Boolean returnProxies)
   at
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor
session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
QueryParameters queryParameters)

Following this exception are intermittent failures like this one,
where the ID field of a table is out of range. This is a table on
which successful queries were being performed before the "Session is
closed!" exception.

System.IndexOutOfRangeException: PERSON1_70_0_
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String
fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at NHibernate.Driver.NHybridDataReader.GetOrdinal(String name)
   at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String
name)
   at NHibernate.Loader.Loader.GetKeyFromResultSet(Int32 i,
IEntityPersister persister, Object id, IDataReader rs,
ISessionImplementor session)
   at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader
resultSet, ISessionImplementor session, QueryParameters
queryParameters, LockMode[] lockModeArray, EntityKey
optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean
returnProxies)
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
QueryParameters queryParameters, Boolean returnProxies)
   at
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor
session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
QueryParameters queryParameters)

Has anyone experienced this sort of behavior? What might cause it?

Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to