Bug 1247343 - HHH-8456 Hibernate Envers throws RuntimeException in ValidityAuditStrategy when no audit records (table partitioning)
Summary: HHH-8456 Hibernate Envers throws RuntimeException in ValidityAuditStrategy wh...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.3.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Gail Badner
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-27 19:29 UTC by Alexandre Cavalcanti
Modified: 2019-08-15 04:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-13 09:46:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Log of the exception (4.29 KB, text/plain)
2015-07-27 19:29 UTC, Alexandre Cavalcanti
no flags Details

Description Alexandre Cavalcanti 2015-07-27 19:29:23 UTC
Created attachment 1056732 [details]
Log of the exception

1. Proposed title of this feature request

Not throwing that RuntimeException based on a configuration in persistence.xml

2. Who is the customer behind the request?
     Account: PROCERGS - Companhia de Processamento de Dados do Rio Grande do Sul (acct #633668)
     TAM customer: yes (Platform only)
     SRM customer: yes
     Strategic: yes
3. What is the nature and description of the request?

Customer is having the problem below:

*********
In Hibernate Envers (persistence.xml), I enabled the strategy for table partitioning, according to the development guide: 
http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html/ch15.html#envers-partitioning

The class: ValidityAuditStrategy, throws RuntimeException when there is no audit record. This exception occurs when the Envers try to update an audit record with a date of final revision (revend_tstmp), but this audit record does not exist.

The database of my application receives data load from external applications and is not possible change these external applications to include their audit records.

In method ValidityAuditStrategy#updateLastRevision:

if (l.size() == 1) {
  //... doStuff - OK
} else {
  throw new RuntimeException("Cannot find previous revision for entity " + auditedEntityName + " and id " + id);
}
*********

In order to solve this problem he asked for a way to not throwing that RuntimeException based on a configuration in persistence.xml (for example)

Customer stated a similiar issue with no solution in: https://developer.jboss.org/thread/160195?tstart=0

4. Why does the customer need this? (List the business requirements here)

Red Hat doesn't have a suitable workaround for this issue

5. How would the customer like to achieve this? (List the functional requirements here)

He asked for a way to not throwing that RuntimeException based on a configuration in persistence.xml (for example)

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

Customer can run in their environment to test
Red Hat can replicate customer envirnment

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

No

8. Does the customer have any specific time-line dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

No

9. Is the sales team involved in this request and do they have any additional input?

No

10. List any affected packages or components.

Hibernate Envers 4.2.12.Final

11. Would the customer be able to assist in testing this functionality if implemented?

Yes

Comment 2 Gail Badner 2015-07-31 03:07:05 UTC
https://hibernate.atlassian.net/browse/HHH-8456


Note You need to log in before you can comment on or make changes to this bug.