Opened 14 years ago

Last modified 14 years ago

#1555 closed defect

Exception: Could not execute native bulk manipulation query when editing a unit — at Version 1

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 2.16.1
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

I think this only happens when using PostgreSQL as the database. Reproducing it is simple.

  1. Go to Administrate -> Types -> Units and quantities.
  2. Select any item in the list.
  3. Select any unit in the list of units.
  4. Open the edit dialog for the unit.
  5. Save (you don't have to change anything)

The save fails:

BaseException
...at HibernateUtil.executeUpdate(HibernateUtil.java:1404)
...at Unit.changeReferenceFactorAndOffset(Unit.java:531)
...at org.apache.jsp.admin.quantities.units.index_jsp._jspService(index_jsp.java:173)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

Caused by: org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
...at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
...at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
...at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:219)
...at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1300)
...at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:365)
...at HibernateUtil.executeUpdate(HibernateUtil.java:1400)
...at Unit.changeReferenceFactorAndOffset(Unit.java:531)
...at org.apache.jsp.admin.quantities.units.index_jsp._jspService(index_jsp.java:173)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

Caused by: org.postgresql.util.PSQLException: ERROR: relation "integervalues" does not exist
  Position: 8
...at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
...at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
...at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
...at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
...at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:210)
...at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1300)
...at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:365)
...at HibernateUtil.executeUpdate(HibernateUtil.java:1400)
...at Unit.changeReferenceFactorAndOffset(Unit.java:531)
...at org.apache.jsp.admin.quantities.units.index_jsp._jspService(index_jsp.java:173)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

The important part is ERROR: relation "integervalues" does not exist and this is true, since the name of the table is actually IntegerValues. I think the problem can be fixed by proper quoting of the table names.

Another issue is that the query should not be executed at all in the first place since I don't change the conversion formula but that is another ticket (#1556).

Change History (1)

comment:1 by Nicklas Nordborg, 14 years ago

Description: modified (diff)

There is a similar exception when changing the default unit for an annotation type.

BaseException
...at HibernateUtil.executeUpdate(HibernateUtil.java:1404)
...at AnnotationType.setDefaultUnit(AnnotationType.java:421)
...at org.apache.jsp.admin.annotationtypes.index_jsp._jspService(index_jsp.java:310)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

Caused by: org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
...at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
...at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
...at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:219)
...at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1300)
...at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:365)
...at HibernateUtil.executeUpdate(HibernateUtil.java:1400)
...at AnnotationType.setDefaultUnit(AnnotationType.java:421)
...at org.apache.jsp.admin.annotationtypes.index_jsp._jspService(index_jsp.java:310)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

Caused by: org.postgresql.util.PSQLException: ERROR: relation "doublevalues" does not exist
  Position: 8
...at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
...at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
...at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
...at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
...at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
...at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:210)
...at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1300)
...at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:365)
...at HibernateUtil.executeUpdate(HibernateUtil.java:1400)
...at AnnotationType.setDefaultUnit(AnnotationType.java:421)
...at org.apache.jsp.admin.annotationtypes.index_jsp._jspService(index_jsp.java:310)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:69)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
...at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
...at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
...at java.lang.Thread.run(Thread.java:619)

Note: See TracTickets for help on using tickets.