Grails

Grails seems to ignore configClass in DataSource.groovy when a custom dataSource bean is in use.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.0.2
  • Component/s: Configuration, Persistence
  • Labels:
    None
  • Testcase included:
    yes

Description

After adding a "dataSource" bean to resources.groovy none of the GORM dynamic methods are applied to my Java based and hibernate annotated domain classes.

I have attached a sample application that reproduces the issue.

  1. Extract datasource-test.zip
  2. grails run-app
  3. browse to http://localhost:8080/datasource-test/contact/list
  4. Get Error --> Message: No signature of method: static com.example.contacts.Contact.list() is applicable for argument types: (org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap) values: {["max":10, "action":"list", "controller":"contact"]}

To be sure the app is ok..

  1. Comment out the dataSource bean in resources.groovy
  2. grails run-app
  3. browse to http://localhost:8080/datasource-test/contact/list
    No errors

I will continue to look for a patch...

Activity

Hide
Ray Krueger added a comment -

Cross posting from the mailing list for the sake of this bug...

Ok...
The HibernateGrailsPlugin is just broken in this regard. In grails
1.0.1 the HibernateGrailsPlugin.groovy at line 93 explicitly checks
for an external datasource config. If there is one it doesn't bother
setting up any of the Hibernate functionality.

I would have to make a bunch of changes to the plugin to get around
this. Am I just doing something wrong? This seems like a big hole,
meaning I must have missed something...

Show
Ray Krueger added a comment - Cross posting from the mailing list for the sake of this bug... Ok... The HibernateGrailsPlugin is just broken in this regard. In grails 1.0.1 the HibernateGrailsPlugin.groovy at line 93 explicitly checks for an external datasource config. If there is one it doesn't bother setting up any of the Hibernate functionality. I would have to make a bunch of changes to the plugin to get around this. Am I just doing something wrong? This seems like a big hole, meaning I must have missed something...
Hide
Ray Krueger added a comment -

I would upgrade this to a blocker now if Jira would let me.

Show
Ray Krueger added a comment - I would upgrade this to a blocker now if Jira would let me.
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: