We are using NHibernate within Web Services hosted by IIS.
We are facing a problem with NHibernate generating different column aliases for identical queries executed by different sessions. It is similar to one faced by Hibernate community - see
http://opensource.atlassian.com/project ... e/HHH-2448.
Our queries use parameters and are identical - we actually tested this issue by emulating load testing using the same query - most aliases were different.
This is a problem on its own because Sql Server cannot re-use cached execution plan (it requires the SQL to be identical) and has to recompile each request.
It is, however, compounded when large number of request are coming in - since all queries are considered being different - Sql Server is trying to compile them and is placing wait lock on compilation cache, effectively grinding execution to a halt.
We are looking for a way to either direct NHibernate to use consistent aliases or for a pointers into where in a source code we can change it (we already did some NHibernate changes, so it is acceptable).
Regards,
Sam