I'm having a problem doing a select. I have a search page where I will eventually be doing a select from a single Oracle table. I have read only access to the database. My search works some times and other times it fails. What is weird is that it always fails on the same search criteria and it always is successful on other search criteria. (ie, in my DB table, I have a column named 'route'. I can run the search successfully using the criteria, 'R14', however the search fails with the criteria, 'R13'.) I can successfully run queries against the database directly, so I know it isn't a data problem. The error I'm getting is a org.springframework.orm.hibernate3.HibernateJdbcException. Below is how the error comes across in my log file. I know HibernateJdbcException is not listed in the log, but I found this while debugging and stepping through my code.
As you can see from the log file entry below, it is telling me I have "insufficient privileges", which doesn't make any sense, since, 1) the query works directly against the database and 2) the query works depending on the search criteria. My Hibernate properties are listed below as well. All the columns in the database table are of type VARCHAR2 and being mapped to Strings.
I'm running this on my development environment, which is, Weblogic 8.1.7, Windows XP, Oracle 8.1.6, Spring 2.0.5, and Hibernate 3.2.0. I've tried to switch to a different driver, but I got the same result. Let me know if there is additional information which would be useful.
LOG FILE ENTRY
2007-07-19 13:16:28,398 INFO [com.logistics.routecode.component.DefaultRouteCodeService] ExecuteThread: '14' for queue: 'weblogic.kernel.Default'
Route Code search by Route: R13
2007-07-19 13:18:10,733 WARN [org.apache.commons.logging.impl.Log4JLogger] ExecuteThread: '14' for queue: 'weblogic.kernel.Default'
SQL Error: 1031, SQLState: HY000
2007-07-19 13:18:10,743 ERROR [org.apache.commons.logging.impl.Log4JLogger] ExecuteThread: '14' for queue: 'weblogic.kernel.Default'
[BEA][Oracle JDBC Driver][Oracle]ORA-01031: insufficient privileges
2007-07-19 13:18:10,743 ERROR [org.apache.commons.logging.impl.Log4JLogger] ExecuteThread: '14' for queue: 'weblogic.kernel.Default'
Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:388)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:363)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:830)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:826)
at com.logistics.routecode.dao.hbm.HibernateRouteCodeDAO.getRouteCodesByRoute(HibernateRouteCodeDAO.java:36)
at com.logistics.routecode.component.DefaultRouteCodeService.findRouteCodesByRoute(DefaultRouteCodeService.java:111)
at com.logistics.routecode.component.DefaultRouteCodeService.findRouteCodes(DefaultRouteCodeService.java:82)
at com.logistics.routecode.controller.SearchController.doSubmitAction(SearchController.java:23)
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:415)
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:382)
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(SimpleFormController.java:356)
at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:258)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:250)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:806)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:736)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: weblogic.jdbc.base.BaseBatchUpdateException: [BEA][Oracle JDBC Driver][Oracle]ORA-01031: insufficient privileges
at weblogic.jdbc.base.BasePreparedStatement.executeOneStatementAtATime(Unknown Source)
at weblogic.jdbc.base.BaseStatement.executeBatchEmulation(Unknown Source)
at weblogic.jdbc.base.BasePreparedStatement.executeBatch(Unknown Source)
at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:186)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 36 more
HIBERNATE PROPERTIES
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
CODE WITH THE ERROR
return getHibernateTemplate().find(
"from RouteCode as rc " +
"where " +
"upper(rc.routeCodeID.route) = ? ",
route.toUpperCase());
|