AdoException on each first "Sign in" attempt

Topics: Troubleshooting
Mar 2, 2011 at 10:43 PM

It's only happening on one PC of several ones. Each first login attempt (after appdomain start) results in the error below, a reload then works as nothing had have happened. I can't spot any module in the stacktraces so I wonder would could have happened:

NHibernate.ADOException was unhandled by user code
  Message=While preparing SELECT contentite0_.Id as Id59_0_, contentite0_.Data as Data59_0_, contentite0_.ContentType_id as ContentT3_59_0_ FROM Orchard_Framework_ContentItemRecord contentite0_ WHERE contentite0_.Id=@p0 an error occurred
  Source=NHibernate
  StackTrace:
       at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
       at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
       at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
       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.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister)
       at NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId)
       at NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session)
       at NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session)
       at NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
       at NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
       at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
       at NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
       at NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType)
       at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType)
       at NHibernate.Impl.SessionImpl.Get(String entityName, Object id)
       at NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id)
       at NHibernate.Impl.SessionImpl.Get[T](Object id)
       at Orchard.Data.Repository`1.Get(Int32 id)
       at Orchard.Data.Repository`1.Orchard.Data.IRepository.Get(Int32 id)
       at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options)
       at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id)
       at Orchard.ContentManagement.ContentGetExtensions.Get[T](IContentManager manager, Int32 id)
       at Orchard.Core.Settings.Services.SiteService.GetSiteSettings()
       at Orchard.Settings.CurrentSiteWorkContext.Get[T](String name)
       at Orchard.Environment.WorkContextImplementation.<>c__DisplayClass5`1.b__0(IWorkContextStateProvider wcsp)
       at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
       at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
       at Orchard.Environment.WorkContextImplementation.FindResolverForState[T](String name)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at Orchard.Environment.WorkContextImplementation.GetState[T](String name)
       at Orchard.WorkContext.get_CurrentSite()
       at Orchard.Localization.Services.SiteCultureSelector.GetCulture(HttpContextBase context)
       at Orchard.Localization.Services.DefaultCultureManager.<>c__DisplayClass8.b__3(ICultureSelector x)
       at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
       at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.OrderedEnumerable`1.d__0.MoveNext()
       at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
       at Orchard.Localization.Services.DefaultCultureManager.GetCurrentCulture(HttpContextBase requestContext)
       at Orchard.Localization.Services.CurrentCultureWorkContext.b__0[T](WorkContext ctx)
       at Orchard.Environment.WorkContextImplementation.<>c__DisplayClass5`1.b__3()
       at Orchard.Environment.WorkContextImplementation.GetState[T](String name)
       at Orchard.WorkContext.get_CurrentCulture()
       at Orchard.Localization.Text.Get(String textHint, Object[] args)
       at Orchard.Users.Controllers.AccountController.LogOn()
       at lambda_method(Closure , ControllerBase , Object[] )
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.b__12()
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
  InnerException: System.InvalidOperationException
       Message=The connection object can not be enlisted in transaction scope.
       Source=System.Data.SqlServerCe
       StackTrace:
            at System.Data.SqlServerCe.SqlCeConnection.Enlist(Transaction tx)
            at System.Data.SqlServerCe.SqlCeConnection.Open()
            at NHibernate.Connection.DriverConnectionProvider.GetConnection()
            at NHibernate.AdoNet.ConnectionManager.GetConnection()
            at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
       InnerException: 

Developer
Mar 8, 2011 at 3:15 AM

I have the same when trying to do any DB related stuff (eg. fetching some data through my custom service, injected via constructor) from IShapeTableProvider implementing object:/