Skip to content

Missing Row Count in Debug Log for Future queries #2296

@Danielle9897

Description

@Danielle9897

Using this (simplified) code (running with Dotnet Core):

public void Execute(ISessionFactory factory)
{
        using(var session = factory.OpenSession())
        using(var tx = session.BeginTransaction())
        {
            // Total row number is not written to log
             var future = session.CreateQuery("select Id As Id from Post")
     		                 .SetResultTransformer(Transformers.AliasToBean<PostId>())
		                 .Future<PostId>();
	      future.ToList(); 

               // This is ok - total row number is written to log   
               // session.CreateCriteria<Blog>().List<Blog>();    

               tx.Commit();
        }
}

public class PostId
{
     public int Id { get; set; }
}
  1. With NHibernate 5.2.6, The total 'row count' log message is Not written to the log
    I only receive the following:
    "result row: "
    (from NHibernate.Loader.Loader:)
    with No row count information!

  2. With the previous Nhibernate 5.1.3, the total was written and we had (for example):
    "result set row: 1"
    (from NHibernate.Impl.MultiQueryImpl)

    AND we also got:

    "done processing result set (10 rows)"
    (from NHibernate.Impl.MultiQueryImpl)

  3. I see that MultiQueryImpl is obsolete

    [Obsolete("Use Multi.QueryBatch instead, obtainable with ISession.CreateQueryBatch.")]

  4. BUT, for example, when the following code snippet is run (with NHibernate 5.2.6):
    session.CreateCriteria<Blog>().List<Blog>();
    we do get the expected msg in the log from Loader.cs
    "done processing result set (5 rows)"
    (from NHibernate.Loader.Loader:)

  5. So, can you please provide this missing functionality?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions