My application needs to execute a non query sql statement, but NHibernate tries to clean my cache whenever I execute a nonquery like this
currentSession.CreateSQLQuery("SET NAMES 'utf8'").ExecuteUpdate();
. I found the following in the source code in NativeSQLQueryPlan.cs Anyone knows why NHibernate is clearing the cache? and how can I avoid that? Thanks.
Code:
public int PerformExecuteUpdate(QueryParameters queryParameters, ISessionImplementor session)
{
CoordinateSharedCacheCleanup(session);
if (queryParameters.Callable)
{
throw new ArgumentException("callable not yet supported for native queries");
}
..........
result = session.Batcher.ExecuteNonQuery(ps);
......................
}