sHIELD
sHIELD

Reputation: 31

create envers audit table at different database and preferrably logging done in a different transaction

Hibernate envers creates the audit tables in the same database ,I needed to use other database at a different location to create and maintain these audit tables (preferrable not in the same transaction). As per my understanding the logging is done in the same transaction as that of the audited domain table updation or insertion etc. I know that logically it has been taken care of in envers that if the audit fails the transaction should rollback , but in my case it does not matter if the logging fails for some of the items. It would be just fine even if it is the same transaction but the audit table location is the separate database. Please Suggest me how to do that or if it is possible at all. Thanks in advance

Upvotes: 3

Views: 1755

Answers (1)

Dherik
Dherik

Reputation: 19050

As described here, you can use a different schema/catalog:

The default schema name that should be used for audit tables. Can be overridden using the @AuditTable(schema="...") annotation. If not present, the schema will be the same as the schema of the table being audited.

Upvotes: 1

Related Questions