Did you do live debugging on the Test environment? And what if you downloaded the database and do a local restore? Because then you can check what there is actual in the database.
I do not believe in a corrupt database unless you fire sql directly with Java on your database.
So try the live debug first and secondly inspect the postgres database locally.
Thanks Ronald, yes we did. We restored the database but locally everything went right but on our test environment it goes wrong.
Our acceptance environment works fine.
I think you make a "where is my data” mistake.
If you retrieve it by association, it will first try to retrieve it from memory, if not found then from database. So in rare cases (and you might have found one) you can have the object empty in your memory as found by association and while your database version has data.
Guess when you would change the retrieve from database (with association as constraint) then you'll find the object with data.
Solution; check what is happening in your memory before the commit and retrieve.
Thank you both for your support.
There is no change between the commit and the retrieve. This issue only occurs on our test environment, but not locally, on acceptance environment and on our production environment.
For now we have added it to our backlog so we are able to dive into it again later, since it is not an issue on the necessary environment(s).