org.hibernate.exception.SQLGrammarException: could not fetch initial value for increment generator

Coderanch | Peter Song | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Something wrong for hibernate!

    Coderanch | 6 years ago | Peter Song
    org.hibernate.exception.SQLGrammarException: could not fetch initial value for increment generator
  2. 0

    [HHH-3797] Incorrect SQL syntax for EJB query involving Entity with composite Key - Hibernate JIRA

    atlassian.net | 2 years ago
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
  3. 0

    Ajuda JPA

    com.br | 2 years ago
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Incorrect syntax near 'value'.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. ruifung 1 times, last 7 months ago
12 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    Object 'PetInfo' is futile。

    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic()
  2. jTDS
    JtdsPreparedStatement.executeQuery
    1. net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
    2. net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
    3. net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
    4. net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
    5. net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
    6. net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)
    6 frames
  3. Hibernate
    IncrementGenerator.generate
    1. org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:85)
    2. org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:44)
    2 frames
  4. Hibernate
    SessionImpl.save
    1. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:91)
    2. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
    3. org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
    4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
    5. org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
    6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
    7. org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
    8. org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
    9. org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
    9 frames
  5. com.lovo.epet
    RegisterAction.execute
    1. com.lovo.epet.dao.impl.PetInfo.insertPet(PetInfo.java:45)
    2. com.lovo.epet.service.impl.AddPet.addPetInfo(AddPet.java:22)
    3. com.lovo.epet.struts.action.RegisterAction.execute(RegisterAction.java:57)
    3 frames
  6. struts
    ActionServlet.doPost
    1. org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    2. org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    3. org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    4. org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    4 frames
  7. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    2. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    2 frames
  8. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    8 frames
  9. Grizzly HTTP
    JIoEndpoint$Worker.run
    1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    3 frames
  10. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:619)
    1 frame