-->
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: JDBC batch update : ORA-22922: nonexistent LOB value
PostPosted: Wed Apr 04, 2007 3:56 pm 
Newbie

Joined: Wed Apr 04, 2007 3:29 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

I am using hibernate with spring. This error "ORA-22922: nonexistent LOB value" is thrown intermittently while updating a table that has a CLOB column.
When I looked in other database forums (http://www.error-code.org.uk/view.asp?c ... A&ec=22922), I found that this error is thrown by database when the LOB column does not have the proper handle while updating that record.. To solve this error, that record needs to be retrieved using "SELECT" statement before updating that record. This retrieval will update the LOB column's handle.

In the below code, ContentSet is the model that need to be updated. Before updating, I am doing a retrieve. But still I am getting this exception sometimes. How do we make sure that it does the database retrieve before updating?

ContentSet retrievedContentSet = (ContentSet) getHibernateTemplate().get(ContentSet.class, contentSetId, LockMode.UPGRADE);
retrievedContentSet.setCsStatus(status);
getHibernateTemplate().save(retrievedContentSet);

Please advise me if any body has any idea about this problem...

Hibernate version: Hibernate 3.0

Mapping documents: http://www.error-code.org.uk/view.asp?c ... A&ec=22922

Code between sessionFactory.openSession() and session.close():

ContentSet retrievedContentSet = (ContentSet) getHibernateTemplate().get(ContentSet.class, contentSetId, LockMode.UPGRADE);
retrievedContentSet.setCsStatus(status);
getHibernateTemplate().save(retrievedContentSet);

Full stack trace of any exception that occurs:

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [update CST_CONTENT_SET set DESCRIPTION=?, RECIPE=?, LAST_MODIFIED=?, CS_STATUS=?, UPDATE_MODE=?, CRON_EXPRESSION=?, MCI_LOAD_STATUS=? where ID=?]; SQL state [99999]; error code [22922]; ORA-22922: nonexistent LOB value
; nested exception is java.sql.BatchUpdateException: ORA-22922: nonexistent LOB value
: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [update CST_CONTENT_SET set DESCRIPTION=?, RECIPE=?, LAST_MODIFIED=?, CS_STATUS=?, UPDATE_MODE=?, CRON_EXPRESSION=?, MCI_LOAD_STATUS=? where ID=?]; SQL state [99999]; error code [22922]; ORA-22922: nonexistent LOB value
; nested exception is java.sql.BatchUpdateException: ORA-22922: nonexistent LOB value

org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(Ljava/lang/String;Ljava/lang/String;Ljava/sql/SQLException;)Lorg/springframework/dao/DataAccessException;(SQLStateSQLExceptionTranslator.java:120)
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(Ljava/lang/String;Ljava/lang/String;Ljava/sql/SQLException;)Lorg/springframework/dao/DataAccessException;(SQLErrorCodeSQLExceptionTranslator.java:276)
org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(Lorg/hibernate/JDBCException;)Lorg/springframework/dao/DataAccessException;(HibernateAccessor.java:424)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(Lorg/hibernate/HibernateException;)Lorg/springframework/dao/DataAccessException;(HibernateAccessor.java:411)
com.gale.cs.workflow.contentset.biz.service.impl.ContentSetCatalogServiceImpl.insertOrUpdateContentSet(Lcom/gale/cs/workflow/contentset/model/ContentSet;Ljava/util/List;Ljava/util/Map;)V(Optimized Method)
jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Optimized Method)
java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Optimized Method)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(AopUtils.java:318)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint()Ljava/lang/Object;(ReflectiveMethodInvocation.java:203)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;(ReflectiveMethodInvocation.java:162)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object;(TransactionInterceptor.java:107)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;(ReflectiveMethodInvocation.java:185)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(JdkDynamicAopProxy.java:209)
$Proxy52.insertOrUpdateContentSet(Lcom/gale/cs/workflow/contentset/model/ContentSet;Ljava/util/List;Ljava/util/Map;)V(Unknown Source)


Name and version of the database you are using:

Oracle 10g

The generated SQL (show_sql=true):

update CST_CONTENT_SET set DESCRIPTION=?, RECIPE=?, LAST_MODIFIED=?, CS_STATUS=?, UPDATE_MODE=?, CRON_EXPRESSION=?, MCI_LOAD_STATUS=? where ID=?

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject: Re: JDBC batch update : ORA-22922: nonexistent LOB value
PostPosted: Tue Jul 28, 2009 3:28 am 
Beginner
Beginner

Joined: Mon Aug 23, 2004 12:44 am
Posts: 25
Hello,

Did you find the cause of the problem ?

How did you fix things ?

Kind regards,
EDH


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.