-->
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.  [ 2 posts ] 
Author Message
 Post subject: will a select query update the table?
PostPosted: Tue Jun 23, 2009 11:32 am 
Newbie

Joined: Tue Jun 23, 2009 11:18 am
Posts: 1
Hi, I'm running my module as a database user who is having only read access to the tables. While trying to query some data I'm getting the following exception.

org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
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.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:749)
Caused by: java.sql.BatchUpdateException: ORA-01031: insufficient privileges


Can some one help me to understand this exception? why it is trying to update while running a select query? How to suppress this exception?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: will a select query update the table?
PostPosted: Tue Jun 23, 2009 9:27 pm 
Beginner
Beginner

Joined: Wed Jun 17, 2009 9:03 pm
Posts: 31
Location: mumbai
Are you changing property of any other persistance object loaded in same session. Hibernate may try to synchronize the persistance context with database before query execution. Have you tried with setting FlushMode to commit or manual ? Also check with loading objects with read only option

Query q = session.createQuery("from Item")
.setReadOnly(true);
Criteria criteria = session.createCriteria(Item.class)
.setReadOnly(true);


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.