We are using Hibernate Envers for audit. Everything work on our local machines. But when we deploying our Spring Boot applications to Tomcat 9 on CentOS 7, envers cannot audit datas. Postgres version: 13
The exception;
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
It says revınfo doesn't exist but actually it does. Revinfo table name: "revinfo" Probably there is an encoding issue. Here our settings for 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");
We are using snake case on tables. Do you have any idea?