当我在数据库中进行直接更改时,它不会反射(reflect)在请求的 web 服务响应中,但是一旦我重新启动服务器它就会工作。我怎样才能使更改立即生效?
我的 hibernate 配置文件如下所示:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/demo</property>
<property name="hibernate.connection.username">xxxx</property>
<property name="hibernate.connection.password">xxxx</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
</session-factory>
</hibernate-configuration>
最佳答案
这是因为您将 use_second_level_cache 设置为 true。 将 use_second_level_cache 的值更改为 false 并且每次都会在不使用二级缓存的情况下命中 db
关于mysql - 为什么在数据库中直接更改时 Hibernate 响应没有反射(reflect)出来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29796049/