Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0.M6
-
Fix Version/s: 1.0.0.M7
-
Labels:None
-
Environment:Mac OSX, Grails 1.3.7, Java 6
Description
If a domain object is updated and that domain class has a hasMany with references to other domain classes, then those domain objects are also updated (last updated and version). This becomes an issue inside of a withTransaction block when those hasMany objects are used and not expected to be updated. An OptimisticLockingException is thrown. We can get around this by using lists of IDs instead of domain classes in the hasMany.
Fixed by https://github.com/SpringSource/spring-data-mapping/commit/a8e4f710e6b10452d76780bdaf5f3a02e82a0db2