History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-1013
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Marc Palmer
Reporter: Marc Palmer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails

Intermittently, project can get into a state where id+version compilation injection operation does not execute

Created: 03/Apr/07 04:49 AM   Updated: 05/Apr/07 04:44 PM
Component/s: Persistence
Affects Version/s: 0.5-RC1
Fix Version/s: 0.5-RC1

Time Tracking:
Not Specified


 Description  « Hide
The symptom of this is test-app and run-app complaining that they cannot find the dynamic methods such as save()

Full debug logging shows that the injection operation is not executing for these domain classes. It may be linked to having a unit test base class in src/groovy - there is a problem of test cases not being able to resolve base classes in grails-tests/ so I tried moving base class to src/groovy and then all thge dynamic domain class methods disappear.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marc Palmer - 03/Apr/07 05:41 AM
To add more detail, HibernateGrailsPlugin does not add the dynamic methods because GrailsApplication.getDomainClasses() returns nothing, because DomainClassArtefactHandler cannot find any classes that have id + version attributes.

This is obviously a bug but opens the wider issue of how identifying domain classes is rather flimsy relying on these attributes.


Marc Palmer - 03/Apr/07 03:30 PM
I've tracked this down.

Domain classes have id+version added at runtime. If you have code in src/groovy that references domain classes, those domain classes will be compiled to disk by groovyc. This then prevents the injection of id+version at runtime as the class is found on the classpath already.