Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we do the reverting to a particular revision using Versioning and Auditing with spring data Envers? please provider me an example for reverting #53

Closed
ganeshvidyayug opened this issue Mar 22, 2023 · 2 comments

Comments

@ganeshvidyayug
Copy link

No description provided.

@bytefish
Copy link
Owner

Sorry, I am not much into Hibernate Envers anymore and cannot provide an example. I don't think there is a simple way to revert changes using the Envers API, the simplest way is to read the old version and update your entities current values.

@ganeshvidyayug
Copy link
Author

Hi byteFish, thanks for your response,
but when am trying the update entity by doing changes from the respective revision , am not able to do, am getting below exception, can you please suggest me the solution

org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:571)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711)
:
:

Caused by: javax.persistence.RollbackException: Error while committing the transaction
at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:81)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:562)
... 128 more
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants