tags:

views:

76

answers:

2

Hello

is it possible to record sql queries being generated by nhibernate criteria ?, i have a disconnected scenario where i can use these query hashes as keys to cache result sets on client.

many thanks

A: 

I don't think that it is possible that easily. (It probably is using events, but I wouldn't do this) You should put the calls to get objects behind an interface. You can exchange the implementation to either call the server or take objects from the cache.

I wouldn't use NHibernate Criteria on the client side.

Stefan Steinegger
The criteria is not being used on the client side, its just being wrapped in a command and executed on the server, if i could get to the exact query that was executed for the criteria, it could become a great caching key on the client, if not then i would have to write a hashcode function, which can be messy
A: 

you could try using nh prof. i believe it has the functionality you desire

Jason Irwin
I am looking for something i can catch in my code, and implement some cross cutting logic on it