Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta2
-
Fix Version/s: 1.1-RC1
-
Component/s: Persistence
-
Labels:None
-
Environment:windows xp
-
Testcase included:yes
Description
On validation of an one-to-many association a LazyInitializationException is thrown.
This happens when accessing the corresponding collection in a custom validator.
In Grails 1.0.4 it works without problems.
-
Hide
- custom_validator_bugreport.zip
- 15/Jan/09 9:28 AM
- 34 kB
- Joern Voelker
-
- custom_validator_bugreport/application.properties 0.1 kB
- custom_validator_bugreport/.../BootStrap.groovy 0.3 kB
- custom_validator_bugreport/.../Config.groovy 2 kB
- custom_validator_bugreport/.../DataSource.groovy 0.6 kB
- custom_validator_bugreport/.../Searchable.groovy 6 kB
- custom_validator_bugreport/.../resources.groovy 0.0 kB
- custom_validator_bugreport/.../UrlMappings.groovy 0.2 kB
- custom_validator_bugreport/.../Author.groovy 0.2 kB
- custom_validator_bugreport/.../Book.groovy 0.1 kB
- custom_validator_bugreport/.../messages.properties 2 kB
- custom_validator_bugreport/.../messages_de.properties 3 kB
- custom_validator_bugreport/.../messages_es.properties 3 kB
- custom_validator_bugreport/.../messages_fr.properties 2 kB
- custom_validator_bugreport/.../messages_it.properties 2 kB
- custom_validator_bugreport/.../messages_ja.properties 2 kB
- custom_validator_bugreport/.../messages_nl.properties 3 kB
- custom_validator_bugreport/.../messages_pt_BR.properties 3 kB
- custom_validator_bugreport/.../messages_ru.properties 4 kB
- custom_validator_bugreport/.../messages_th.properties 5 kB
- custom_validator_bugreport/.../messages_zh_CN.properties 2 kB
- custom_validator_bugreport/.../error.gsp 2 kB
- custom_validator_bugreport/.../main.gsp 0.7 kB
- custom_validator_bugreport/.../AuthorTests.groovy 0.5 kB
- custom_validator_bugreport/.../0_AuthorTests.html 5 kB
- custom_validator_bugreport/.../0_AuthorTests-err.txt 0.1 kB
- custom_validator_bugreport/.../0_AuthorTests-errors.html 5 kB
- custom_validator_bugreport/.../0_AuthorTests-out.txt 0.0 kB
- custom_validator_bugreport/.../allclasses-frame.html 0.5 kB
- custom_validator_bugreport/.../all-tests.html 3 kB
- custom_validator_bugreport/.../alltests-errors.html 3 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Hide
Guillaume Laforge
added a comment -
With the top of the GROOVY_1_6_0 branch, this application is now working properly.
Show
Guillaume Laforge
added a comment - With the top of the GROOVY_1_6_0 branch, this application is now working properly.
Show
Peter Ledbrook
added a comment - Fixed by the upgrade to Groovy 1.6.0 RC3.
Show
Peter Ledbrook
added a comment - Oops, meant to resolve it, not just add a comment
Show
Graeme Rocher
added a comment - Bulk closing bunch of resolved issues
Just to keep you informed, this problem occurs because of a change in the behaviour of Groovy's findAll() method. One workaround is to copy the collection before doing a findAll():
def tmp = [] obj.items.each { tmp << it } tmp.findAll { ... }For more efficient execution, write a static method that iterates over the collection and explicitly adds found items to a list. In effect, write your own implementation of findAll().