I have a hibernate mapping with a sequence mapped like so:
<id name="key" column="TOOLKIT_KEY"> <generator class='sequence' /> </id>
The db has a HIBERNATE_SEQUENCE defined and I can insert rows using this sequence via sqlplus
In the output below, hibernate is trying to perform a function call instead of a select hibernate_sequence.nextval from dual which I would expect. What am I doing wrong here?
The logging when trying to perform an insert into the table is this:
17:11:43,079 TRACE [DefaultSaveOrUpdateEventListener] saving transient instance 17:11:43,079 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 17:11:43,079 DEBUG [SQL] call next value for hibernate_sequence 17:11:43,079 INFO [STDOUT] Hibernate: call next value for hibernate_sequence 17:11:43,079 TRACE [AbstractBatcher] preparing statement 17:11:43,219 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 17:11:43,219 TRACE [AbstractBatcher] closing statement 17:11:43,219 DEBUG [JDBCExceptionReporter] could not get next sequence value [call next value for hibernate_sequence] java.sql.SQLException: ORA-06576: not a valid function or procedure name
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:952) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236) at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:98) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:546) at org.ncems.cis.toolkit.dao.PersistenceManager.saveObject(PersistenceManager.java:181) at org.ncems.cis.toolkit.dao.ToolkitDAO.saveObject(ToolkitDAO.java:36) at org.ncems.cis.toolkit.model.BaseRptToolkit.saveToolkit(BaseRptToolkit.java:119) at org.ncems.cis.toolkit.model.BaseRptToolkit.modifyToolkit(BaseRptToolkit.java:72) at org.ncems.cis.toolkit.controller.SaveAction.process(SaveAction.java:50) at com.thotwave.pluglet.framework.PlugletImpl.process(PlugletImpl.java:335) at com.thotwave.pluglet.framework.PFApplicationImpl.process(PFApplicationImpl.java:1040) at com.thotwave.pluglet.framework.AbstractPFApplication.doProcess(AbstractPFApplication.java:1103) at com.thotwave.pluglet.framework.PFApplicationServlet.doPost(PFApplicationServlet.java:253) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ncems.shared.controller.SessionUserStorageFilter.doFilter(SessionUserStorageFilter.java:30) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.thotwave.pluglet.security.SecurityFilter.doFilter(SecurityFilter.java:177) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 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:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) 17:11:43,219 WARN [JDBCExceptionReporter] SQL Error: 6576, SQLState: 65000 17:11:43,219 ERROR [JDBCExceptionReporter] ORA-06576: not a valid function or procedure name
|