bp-FLN opened a new issue, #14455:
URL: https://github.com/apache/grails-core/issues/14455

   ### Task List
   
   - [x] Steps to reproduce provided
   - [ ] Stacktrace (if present) provided
   - [x] Example that reproduces the problem uploaded to Github
   - [x] Full description of the issue provided (see below)
   
   ### Steps to Reproduce
   
   1. run the  Example Application
   2. navigate to http://localhost:8080/test/index to trigger the issue for 
many-to-many
   3. navigate to http://localhost:8080/test/index2 to trigger the issue for 
one-to-many
   
   ### Expected Behaviour
   
   as per documentation, it is not expected that the whole collection is being 
fetched
   see section 5.4.3 here: http://gorm.grails.org/6.1.x/hibernate/manual/#sets
   "...adding to or removing from collections mapped as a Bag don’t trigger a 
load of all existing instances from the database..."
   
   ### Actual Behaviour
   
   The whole locations collection is fetched when calling 
`post.removeFromLocations(location)`, which is very costly if there are  
thousand of items in  the  database.
   
   ### Environment Information
   
   - **Operating System**: MacOS
   - **GORM Version:** 6.1.11.RELEASE
   - **Grails Version (if using Grails):** 3.3.9
   - **JDK Version:** jdk1.8.0_121
   
   ### Example Application
   
   - https://github.com/bp-FLN/gorm-removeFromBag-issue
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to