jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Stories
  • STORIES-20

could not get next sequence value

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

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

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

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jeremy Anderson added a comment - 03/Apr/09 7:19 AM

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 - 03/Apr/09 7:19 AM 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
Permalink
Shane Hayes added a comment - 03/Apr/09 10:03 AM - 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 - 03/Apr/09 10:03 AM - 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
Permalink
Jeremy Anderson added a comment - 03/Apr/09 2:23 PM

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 - 03/Apr/09 2:23 PM 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
Vote (0)
Watch (0)

Dates

  • Due:
    11/Apr/09
    Created:
    02/Apr/09 2:57 PM
    Updated:
    28/Jul/09 7:30 AM
    Resolved:
    28/Jul/09 7:29 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.