NHibernate, query parameters always null


#1

I’m using MiniProfiler with NHibernate (Fluent NH + Postgres on deployment, MySQL on development machine). I’m using this “bridge” to connect MiniProfiler with NHibernate: https://gist.github.com/robertmilne/1110153

The problem is I’m not getting my query parameters. To be exact: each SqlTiming, even those with parametrized Command, has 0-length Parameters list.

Can I solve it somehow?


#2

You might want to take that up with the authors of the NHibernate connector code. It is not something that we provide support for.


#3

Thank you for your response. The connector is slightly modified code I’ve found somewhere on the net. Any clues why it doesn’t work?
The code: http://pastebin.com/t6wMWHuv


#4

The SqlTiming.GetCommandParameters() function (in the version 3 code of MiniProfiler) is what is used to get the parameters. It is called down the line from profiler.ExecuteStart(instance, executeType); on line 61.

Could you set a debug breakpoint on line 61 and see if there is anything inside instance.Parameters?

Can you also make sure that you are using v3 of MiniProfiler?


#5

Yaakov_Ellis, the instance.Parameters seems to be correct, at least the ParameterName and Value of each item seems to be correct.

I’ve been using ServiceStack’s v3 built-in MiniProfiler which I believe is fork of 2.x and also switched to the genuine nuget 2.1 version to make sure it’s not the problem with ServiceStack.
I’ll give a 3.0.10 a try and let you know here.

unfortunately I can’t put image in the post so here’s the link to the debugger screenshot http://i.imgur.com/tx58vJ0.png