Skip to content

mmeany/spring-boot-detached-entity-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

On updating Spring Boot from 1.1.4 to 1.1.5 a simple web application started generating detached entity exceptions. A quick check of loaded dependencies showed that Spring Data has been updated and a further check of the change log shows a couple of issues relating to optimistic locking, version fields and JPA issues that have been fixed.

Well I am using a version field and it starts out as Null following recommendation to not set in the specification.

I have managed to produce a very simple test case now where I get detached entity exceptions if the version field starts as null or zero. If I create an entity with version 1 however then I do not get these exceptions.

The first two tests fail with detached entity exception. The last two tests pass as expected.

Now change Spring Boot version to 1.1.4 and rerun, all tests pass.

Is this expected behaviour or are my expectations wrong?

About

Detached Entity exception when upgrading Spring Boot 1.1.4 to 1.1.5

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages