NHibernate will insert but not update after going to a host with a shared server running mysql

I have a site running MVC and Nhibernate (not fluently), using a standard session for each request in the http module, it runs normally locally (also with mysql), but after switching to the hosting provider no updates are released.

I can insert, but not update, no exceptions arise, I have the show_sql option turned on, in which the written update statements are displayed locally, but no update statements are registered on the server.

I don’t think NHProf is an option for me, since I can run asp.net applications on my shared server, are there any other methods for diagnosing NH problems like this?

Has anyone had a similar problem?

Greetings

A

+1
source share
2 answers

The problem was that I switched from the local local environment from IIS5 to the shared server with IIS7, IIS7 has a different syntax for registering http modules, so my NHibernate session module did not start, which caused the described behavior.

To fix this problem, I added the module section in web.config to system.web for system.webServer, you can add validateIntegratedModeConfiguration = "false" to the system.webServer section, which will allow your configuration to have the module registered in both sections, therefore you can have the same configuration for IIS5 / IIS7.

+1
source

NHProf is the option for you!

, . log4net:

<log4net>
  <appender name="NHProfAppender"
    type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfOfflineAppender, 
    HibernatingRhinos.Profiler.Appender" >
    <file value="nhprof_output.nhprof" />
  </appender>

  <logger name="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender.Setup">
    <appender-ref ref="NHProfAppender"/>
  </logger>
</log4net>

, NHProf, NHibernate , , .

0

Source: https://habr.com/ru/post/1716165/


All Articles