Open spring-projects-issues opened 6 years ago
Mathias Ewald commented
I am currently looking at the same problem. Has anyone found a workaround to this?
Oliver Drotbohm commented
Looks like this could be an easy fix. Can you elaborate what the issue with that (admittedly superfluous) call is?
Mathias Ewald commented
Disclaimer: What I am doing there might be very close to insanity. I am merely a hobby developer :)
In my specific situation, I overwrite the findById method of a JPA repository that serves the same type as AuditorAware provides in order to add some synchronization logic. Somewhere down the line, I call EntityManager#persist (as I said - synchronization stuff) which triggers the implementation of AuditorAware. That in turn calls findById and here comes the stackoverflow error.
I got around that for now by getting rid of JPA auditing and using @PrePersist
and @PreUpdate
to set the creation and modification timestamps.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Yuki Yoshida opened DATACMNS-1404 and commented
When we have below two entities.
And try to save them, then
org.springframework.data.domain.AuditorAware#getCurrentAuditor
was called for both of them.It would be nice when we save entity that does not have
@CreatedBy
or@LastModifiedBy
,AuditorAware#getCurrentAuditor
stop being called.I attached reproduction project (by spring-data-jpa) to Reference URL.
Affects: 2.0.10 (Kay SR10)
Reference URL: https://github.com/sis-yoshiday/spring-data-auditing-issue