postgresql - Hibernate/Postgres revınfo 不存在
问题描述
我们正在使用 Hibernate Envers 进行审计。一切都在我们的本地机器上运行。但是当我们在 CentOS 7 上将 Spring Boot 应用程序部署到 Tomcat 9 时,envers 无法审计数据。Postgres 版本:13
例外;
Caused by: org.postgresql.util.PSQLException: ERROR: relation "revınfo" does not exist
Position: 13
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx ecutorImpl.java:2553)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor Impl.java:2285)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.ja va:323)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedSt atement.java:164)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedState ment.java:130)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPrep aredStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(Hik ariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate( ResultSetReturnImpl.java:197)
... 149 more
它说 revıinfo 不存在,但实际上确实存在。Revinfo 表名:“revinfo” 可能存在编码问题。这里是我们对 jpa 的设置;
put("hibernate.physical_naming_strategy", "foo.app.util.db.HibernatePhysicalNamingStrategy");
put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
put("hibernate.current_session_context_class", "thread");
put("hibernate.session_factory.interceptor", persistenceInterceptor);
// envers
put("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
put("org.hibernate.envers.audit_table_suffix", "_hist");
put("hibernate.characterEncoding", "UTF-8");
put("hibernate.CharSet", "UTF-8");
put("hibernate.useUnicode", "true");
put("hibernate.connection.CharSet", "UTF-8");
put("hibernate.connection.characterEncoding", "UTF-8");
put("hibernate.connection.useUnicode", "true");
我们在桌子上使用蛇盒。你有什么主意吗?
解决方案
推荐阅读
- reactjs - 索引 1 处的 todos 数组总是被更改,并且数组不会进一步移动 - React-Typescript
- python-3.x - Python mqtt 停止发布
- c# - 跨线程操作无效:控件“地址栏”是从创建它的线程以外的线程访问的
- javascript - 将 onclick 按钮添加到 textarea 中的 onkeyup 函数
- javascript - 反应 useFetch 钩子 + onclick / 事件
- javascript - 当我通过 jQuery 中的克隆方法创建一个新按钮时,如何触发删除按钮?
- static-methods - Unittest mock.patch.object(autospec = True)因静态方法而损坏?
- reactjs - html2canvas 不拍摄视频标签屏幕截图
- excel - 使用单元格引用导出 XLS 文件
- reactjs - 反应 /redux 应用程序 - 添加到购物车按钮不起作用 - 单击 TypeError 时:显示