Hello Cedomir, the assertion
was only part of the code by accident. I tried to ‘force’ the entity to be dirty by changing the info-value (see commented line) and that was the assertion for this. Ignore/remove this… What did you change exactly? As far as i can see just adding the name-property to the @Entity-annotation? But that can solve be the problem 🤔 I have the impression that the transaction-handling in your test-code is slightly different compared with my test. In my test adding @Transactional(Transactional.TxType.REQUIRES_NEW) means, every method of the test-class will have it’s own new transaction. So insert, update and select run in different transactions. If i change my test-case and let all methods use the same transaction (by using @Transactional without any value, what defaults to REQUIRED), the assertion is green. So within the transaction, the persistence-context holds&returns the correct value. |