-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Inconsistent error when doig a select from a single table
PostPosted: Thu Jul 19, 2007 2:57 pm 
Newbie

Joined: Fri May 25, 2007 3:58 pm
Posts: 10
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());


Top
 Profile  
 
 Post subject: Re: Inconsistent error when doig a select from a single table
PostPosted: Thu Feb 16, 2017 11:47 am 
Newbie

Joined: Thu Feb 16, 2017 11:41 am
Posts: 2
I am having a similar issue. The code that receives the error is doing a select not an update. I have only seen the error for this query for one particular input; all other inputs I have tried were successful. I can also execute the query successfully when I go directly against the database (and even with the input that fails from the app). I am baffled. Any help is appreciated.


Top
 Profile  
 
 Post subject: Re: Inconsistent error when doig a select from a single table
PostPosted: Fri Feb 17, 2017 3:40 pm 
Newbie

Joined: Thu Feb 16, 2017 11:41 am
Posts: 2
I am having a similar issue. I am getting the Oracle insufficient privileges error when I am only doing selects. And the error only happens for particular input, all other inputs that I have tried have been successful. Why would I be getting a batch update error when I am only doing selects?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.