You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When saving an instance of an Entitt mapped via a Java Record, that the version attribute would be incremented correctly
Actual Behaviour
Upon saving, the following error is observed:
io.micronaut.data.exceptions.DataAccessException: SQL Error executing INSERT: An error occurred invoking pre-persist event listeners: Cannot write a read-only property: version
at io.micronaut.data.runtime.operations.internal.AbstractRepositoryOperations.persistOne(AbstractRepositoryOperations.java:292)
at io.micronaut.data.jdbc.operations.DefaultJdbcRepositoryOperations.lambda$persist$16(DefaultJdbcRepositoryOperations.java:752)
at io.micronaut.transaction.support.AbstractSynchronousTransactionManager.executeWrite(AbstractSynchronousTransactionManager.java:175)
at io.micronaut.data.jdbc.operations.DefaultJdbcRepositoryOperations.persist(DefaultJdbcRepositoryOperations.java:750)
at io.micronaut.data.runtime.intercept.DefaultSaveEntityInterceptor.intercept(DefaultSaveEntityInterceptor.java:45)
at io.micronaut.data.intercept.DataIntroductionAdvice.intercept(DataIntroductionAdvice.java:114)
at io.micronaut.data.intercept.DataIntroductionAdvice.intercept(DataIntroductionAdvice.java:88)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:137)
at io.micronaut.validation.ValidatingInterceptor.intercept(ValidatingInterceptor.java:138)
at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:137)
Expected Behavior
When saving an instance of an Entitt mapped via a Java Record, that the version attribute would be incremented correctly
Actual Behaviour
Upon saving, the following error is observed:
Steps To Reproduce
Using following record impl:
Environment Information
Ubuntu 21.04
Java 16
Example Application
No response
Version
3.1.0
Notes
I've not got past this yet, but I'm wondering if
@DateCreated and
@DateUpdated` might suffer the same problem.The text was updated successfully, but these errors were encountered: