[hibernate-issues] [JIRA] (HHH-14003) Hibernate Envers audit Table Column Changes from jsonb to uuid

ganaraj tejasvi (JIRA) jira at hibernate.atlassian.net
Tue May 5 13:13:59 EDT 2020


ganaraj tejasvi ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A9174e8a0-ad84-4876-a5ee-a61f9802df38 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 ) HHH-14003 ( https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 ) Hibernate Envers audit Table Column Changes from jsonb to uuid ( https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.4.14 Assignee: Chris Cranford ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aea49f1db-ef91-4d96-8f3a-a939be8d2b1c ) Attachments: Screenshot 2020-05-05 at 8.55.48 PM.png, Screenshot 2020-05-05 at 8.56.46 PM.png Components: hibernate-envers Created: 05/May/2020 10:13 AM Priority: Minor Reporter: ganaraj tejasvi ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A9174e8a0-ad84-4876-a5ee-a61f9802df38 )

I have a jsonb column in an Entity annotated as shown in the sample code. Everything works fine without the @Audited annotation. Adding the Audited annotation creates the org_master_aud table with the column custom_fields of type uuid instead of jsonb and the insert fails

```
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
@Audited
public class OrgMaster

{ @Type(type = "jsonb") @Column(columnDefinition = "jsonb",name="custom_fields",nullable=false) private JsonNode customFields; }

```
org.springframework.orm.jpa.JpaSystemException: Unable to perform beforeTransactionCompletion callback: org.hibernate.exception.DataException: could not execute statement; nested exception is org.hibernate.HibernateException: Unable to perform beforeTransactionCompletion callback: org.hibernate.exception.DataException: could not execute statement
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:353)
.
.
.
.
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1352)
... 94 more
Caused by: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type uuid: "{}"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2578)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2313)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:331)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:159)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:125)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
... 105 more

Attached ( https://hibernate.atlassian.net/secure/attachment/49674/49674_Screenshot+2020-05-05+at+8.56.46+PM.png ) ( https://hibernate.atlassian.net/secure/attachment/49673/49673_Screenshot+2020-05-05+at+8.55.48+PM.png ) the Snapshots of the custom_fields column in main and audit table where the audit table column is uuid whereas the main table is jsonb. Both are autogenerated.

( https://hibernate.atlassian.net/browse/HHH-14003#add-comment?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14003#add-comment?atlOrigin=eyJpIjoiODgxNmEyM2IwOTYxNGI5MWE3YzA3NmNjYTM3MjUxOWMiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:bfbb988 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200505/c496a6e2/attachment.html 


More information about the hibernate-issues mailing list