I'm trying to figure out if this behavior is normal or a bug, i've got a 
need to run arbitrary sql through nhibernate, i was using the List method 
off the query, but i need to use Futures for performance reasons. The 
frustrating thing is, when i start using Futures, my resultsettransformer 
isn't passed the data.

Here's an example, 


        public ActionResult Test()
        {
            var sess = MailMessageRepository.Session;
            var x = sess.CreateSQLQuery("select * from 
MailEvent").SetResultTransformer(new 
TestResultSetTransformer()).Future<object[]>();
            var xprime = sess.CreateSQLQuery("select * from 
MailEvent").SetResultTransformer(new 
TestResultSetTransformer()).List<object[]>();
            foreach(var y in x)
            {
                
            }
            return View();
        }
    public class TestResultSetTransformer : IResultTransformer
    {
        public object TransformTuple(object[] tuple, string[] aliases)
        {
            return tuple;
        }

        public IList TransformList(IList collection)
        {
            return collection;
        }
    }


The second call of the query, using List<T>, returns the rows correctly, 
however the first call, using Future<T> returns the correct number of rows, 
however they are all empty arrays. Is there something i'm missing, or a 
workaround to use futures in this way? 

-- 
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/-/lnHxSqzaU3sJ.
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