I just moved a nhibernate application which worked perfectly well on development machine to UAT machine and got the following exception:
Code:
NHibernate.ADOException: Could not execute query ---> System.Threading.ThreadAbortException: Thread was being aborted.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
--- End of inner exception stack trace ---
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.List()
at warehouse.web.utilities.DataManager.GetMasterInventoryList(Int32 pageNo, Int32 pageSize, String filter, ISession session) in c:\inetpub\wwwroot\WarehouseWeb\utilities\DataManager.vb:line 614; Inner Exception: System.Threading.ThreadAbortException: Thread was being aborted.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Loader.OneToManyLoader.Initialize(Object id, PersistentCollection collection, Object owner, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.Initialize(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.GetInitialValue(Boolean lazy)
at NHibernate.Type.PersistentCollectionType.GetCollection(Object id, Object owner, ISessionImplementor session)
at NHibernate.Type.PersistentCollectionType.ResolveIdentifier(Object value, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.DoFind(ISessionImplementor session, QueryParameters parameters, Object optionalObject, Object optionalID, PersistentCollection optionalCollection, Object optionalCollectionOwner, Boolean returnProxies)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters
I dont have much idea about what went wrong, the first place I check is that I synchronized Development database and UAT database so the two is exactly the same both schema and data. Sometimes orphan child records gives very misleading/weird exception ... but then, it wasn't the case and the problem remains.
The next thing I checked was user login/privilege. I granted the account Server Admin right (just for testing) - it did NOT resolve the problem.
So, basically, I eliminated three possibilities:
1. application binaries same between development and UAT (ASP.NET app)
2. SQL database schema + data exactly same... so it's got nothing to do with corrupted data... or some diff in schema - I used SQL Compare to make very precise comparison. In fact, I pointed my UAT application from original UAT database (ATHKTST01) to point at development database (HK1XN2Q11), the problem remains - so whatever it is, it's not in database.
3. It's got nothing to do with SQL login and security
4. Yeah, I rebooted the UAT server (...what professional do...) =)
I'm not quite sure where/what else I should be looking for... Just hope someone out there could point be in right direction and yes, the error message seems pretty vague, not entirely informative... Thanks in advance.