Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Labels:
      None
    • Environment:
      Windows
    • Number of attachments :
      0

      Description

      2009-03-30 21:36:27,265 [4869681@qtp0-0] ERROR StackTrace - Sanitizing stacktrace:
      org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630)
      at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
      at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
      at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.ListPersistentMethod.doInvokeInternal(ListPersistentMethod.java:51)
      at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod.invoke(AbstractStaticPersistentMethod.java:55)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)
      at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_addQueryMethods_closure36.doCall(HibernatePluginSupport.groovy:441)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061)
      at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:910)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
      at groovy.lang.Closure.call(Closure.java:279)
      at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:55)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
      at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1301)
      at groovy.lang.ExpandoMetaClass.invokeStaticMethod(ExpandoMetaClass.java:921)
      at groovy.lang.MetaObjectProtocol$invokeStaticMethod.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)

        Activity

        Hide
        Jeremy Anderson added a comment -

        I'm in the process of getting that fixed. Ideally I wanted to use a unique sequence for each table similar to what's described here http://jira.codehaus.org/browse/GRAILS-3138

        Show
        Jeremy Anderson added a comment - I'm in the process of getting that fixed. Ideally I wanted to use a unique sequence for each table similar to what's described here http://jira.codehaus.org/browse/GRAILS-3138
        Hide
        Shane Hayes added a comment - - edited

        I saw that to. Here is what I tried to add to Project:
        static mapping = {
        columns

        { id column:'id' }

        id generator:'sequence', params:[sequence:'project_id_seq']
        }

        I don't think the db recreate created the sequence. I have not been able to figure out how to trace through the hibernate magic that does the change. I found a couple of references that suggest we need to change some hibernate code to get this to work generically so the specific sequences don't need to be called out.
        Here is a link to a hibernate change: http://xmldo.blogspot.com/2006/08/using-sequence-in-grails-gorm.html

        Here is another link to a different approach to fix the single sequence: http://www.nabble.com/One-%27hibernate_sequence%27-is-used-for-all-Postgres-tables-td17925737.html

        I wonder if part of the problem is the sequence is called out on a generated column?
        Shane

        Show
        Shane Hayes added a comment - - edited I saw that to. Here is what I tried to add to Project: static mapping = { columns { id column:'id' } id generator:'sequence', params: [sequence:'project_id_seq'] } I don't think the db recreate created the sequence. I have not been able to figure out how to trace through the hibernate magic that does the change. I found a couple of references that suggest we need to change some hibernate code to get this to work generically so the specific sequences don't need to be called out. Here is a link to a hibernate change: http://xmldo.blogspot.com/2006/08/using-sequence-in-grails-gorm.html Here is another link to a different approach to fix the single sequence: http://www.nabble.com/One-%27hibernate_sequence%27-is-used-for-all-Postgres-tables-td17925737.html I wonder if part of the problem is the sequence is called out on a generated column? Shane
        Hide
        Jeremy Anderson added a comment -

        We're not depending on Grails to create tables and sequences. We're leveraging the liquibase plugin (http://www.liquibase.org/manual/grails) to do a 'Rails-like' database migration. I'm being proactive about avoiding any upgrade issues in the long run. You'll need to create a changeset for the sequences in the changeset.xml file.

        Show
        Jeremy Anderson added a comment - We're not depending on Grails to create tables and sequences. We're leveraging the liquibase plugin ( http://www.liquibase.org/manual/grails ) to do a 'Rails-like' database migration. I'm being proactive about avoiding any upgrade issues in the long run. You'll need to create a changeset for the sequences in the changeset.xml file.

          People

          • Assignee:
            Shane Hayes
            Reporter:
            Shane Hayes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: