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

@DateCreated: Breaking change in micronaut-parent:4.3.2 #2808

Closed
roar-skinderviken opened this issue Feb 25, 2024 · 8 comments
Closed

@DateCreated: Breaking change in micronaut-parent:4.3.2 #2808

roar-skinderviken opened this issue Feb 25, 2024 · 8 comments
Assignees
Labels
info: workaround available A workaround is available for the issue type: bug Something isn't working

Comments

@roar-skinderviken
Copy link

roar-skinderviken commented Feb 25, 2024

Expected Behavior

When saving an entity with a field like this

    @DateCreated
    @Column(nullable = false)
    var created: ZonedDateTime? = null

I expect field to be populated during persistence of instance like it did with MN:4.3.1.

Actual Behaviour

With MN:4.3.2 in the example application, I get this test-error:

DemoRepositoryTest » PropertyValue not-null property references a null or transient value : no.javatec.demo.repository.DemoEntity.created

Steps To Reproduce

In the example-app, bump micronaut-parent from 4.3.1 to 4.3.2 or 4.3.3 and run

./mvnw clean verify

and observe that tests in DemoRepositoryTest are now failing.

Environment Information

Ubuntu 22.04
JDK 17
Kotlin 1.9.22

Example Application

https://github.com/roar-skinderviken/postgres-testcontainer-demo

Version

4.3.3

@jamesdh
Copy link

jamesdh commented Feb 28, 2024

I previously reported something similar in #2342. I was unaware that it was ever working correctly. I'm currently using 4.2.4 and still experience this.

@radovanradic
Copy link
Contributor

This one is indeed different issue and is caused by micronaut-sql 5.5.1 release. The workaround for this is either adding implementation("io.micronaut.validation:micronaut-validation") dependency or adding this JPA property jpa.default.properties.hibernate.check_nullability=false but probably should fix root cause in micronaut-sql

@sdelamo sdelamo added the info: workaround available A workaround is available for the issue label Mar 8, 2024
@sdelamo sdelamo removed this from 4.3.6 Release Mar 8, 2024
@sdelamo sdelamo removed this from 4.3.5 Release Mar 8, 2024
@sdelamo sdelamo moved this to In Progress in 4.3.6 Release Mar 8, 2024
@sdelamo
Copy link
Contributor

sdelamo commented Mar 14, 2024

@roar-skinderviken I have verified this is solved with 4.3.5

@sdelamo sdelamo closed this as completed Mar 14, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 4.3.6 Release Mar 14, 2024
@roar-skinderviken
Copy link
Author

Hi @sdelamo

Build for this PR created by Dependabot for bumping to MN:4.3.5 fails with the same error:
roar-skinderviken/postgres-testcontainer-demo#45

But I can see that 4.3.6 is mentioned above, so maybe wait for that one.

@roar-skinderviken
Copy link
Author

roar-skinderviken commented Mar 17, 2024

Hi again @sdelamo

Tests are not passing with MN:4.3.6.
roar-skinderviken/postgres-testcontainer-demo#50

Could you please describe how you made tests in the example repo passing with MN:4.3.5?

@sdelamo sdelamo reopened this Mar 18, 2024
@sdelamo
Copy link
Contributor

sdelamo commented Mar 18, 2024

sorry, I had in your sample project both version updated to 4.3.6 and adding the dependency:

        <dependency>
            <groupId>io.micronaut.validation</groupId>
            <artifactId>micronaut-validation</artifactId>
        </dependency>

and that make it work.

@timyates
Copy link
Contributor

I have reverted the change to micronaut-sql micronaut-projects/micronaut-sql#1300

@sdelamo sdelamo moved this to In Progress in 4.3.8 Release Mar 22, 2024
@timyates
Copy link
Contributor

So micronaut-sql 5.5.2 reverts this change, and it will be in the next 4.3.x release of Micronaut (4.3.8)

Thanks @roar-skinderviken for the report!

@github-project-automation github-project-automation bot moved this from In Progress to Done in 4.3.8 Release Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info: workaround available A workaround is available for the issue type: bug Something isn't working
Projects
No open projects
Status: Done
Status: Done
Development

No branches or pull requests

5 participants