Hi,

I'm using ToFuture to run multiple queries in one batch:

            var creative = Session.Query<CreativeShop>().Select(e => 
e.ID).Where(e => e == accountID).ToFuture();
            var publisher = Session.Query<Publisher>().Select(e => 
e.ID).Where(e => e == accountID).ToFuture();
            var agency = Session.Query<Agency>().Select(e => e.ID).Where(e => e 
== accountID).ToFuture();
            var network = Session.Query<Network>().Select(e => e.ID).Where(e => 
e == accountID).ToFuture();

            AccountTypeDTO accountType = new AccountTypeDTO()
            {
                IsCreative = creative != null && creative.Count() > 0,
                IsPublisher = publisher != null && publisher.Count() > 0,
                IsAgency = agency != null && agency.Count() > 0,
                IsNetwork = network != null && network.Count() > 0
            };

Once in a while (actually, about 100 times a day) we are getting the following 
exception from our production:

null)System.Web.HttpUnhandledException: Exception of type 
'System.Web.HttpUnhandledException' was thrown. ---> 
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Exception of type 
'Antlr.Runtime.NoViableAltException' was thrown.
   at NHibernate.Hql.Ast.ANTLR.ErrorCounter.ThrowQueryException()
   at NHibernate.Hql.Ast.ANTLR.HqlParseEngine.Parse()
   at 
NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String
 queryString, String collectionRole, Boolean shallow, IDictionary`2 filters, 
ISessionFactoryImplementor factory)
   at NHibernate.Engine.Query.HQLStringQueryPlan..ctor(String hql, Boolean 
shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory)
   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String 
queryString, Boolean shallow, IDictionary`2 enabledFilters)
   at NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar)
   at NHibernate.Impl.MultiQueryImpl.<GetTranslators>d__0.MoveNext()
   at NHibernate.Impl.MultiQueryImpl.AggregateQueriesInformation()
   at NHibernate.Impl.MultiQueryImpl.get_Parameters()
   at NHibernate.Impl.MultiQueryImpl.CreateCombinedQueryParameters()
   at NHibernate.Impl.MultiQueryImpl.List()
   at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
   at NHibernate.Impl.FutureBatch`2.GetResults()
   at NHibernate.Impl.FutureBatch`2.get_Results()
   at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 
currentIndex)
   at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
   at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)

The weird thing is that we are unable to reproduce this scenario, even with the 
same account ID.
Did someone know the reason for this exception?
We are using NH 3.3.0.4.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/qtxkV7QkdvIJ.
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