Announcement Announcement Module
Collapse
No announcement yet.
java.sql.SQLException: ORA-22922: nonexistent LOB value Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.sql.SQLException: ORA-22922: nonexistent LOB value

    I have the following configuration in a web application

    app-data.xml
    Code:
    <context:property-placeholder location="classpath:dataSource-dev.properties"/>
        
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    		<property name="driverClassName" value="${jdbc.driverClassName}"/>
        	<property name="url" value="${jdbc.url}"/>
        	<property name="username" value="${jdbc.username}"/>
        	<property name="password" value="${jdbc.password}"/>
    	</bean>
    	
    	<bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"/>
        
        <!-- JdbcTemplate -->
    	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    		<property name="dataSource" ref="dataSource"/>
    		<property name="nativeJdbcExtractor">
    			<ref local="nativeJdbcExtractor"/>
    		</property>
    	</bean>
    
    bean id="dao" class="com...">
    		<property name="jdbcTemplate" ref="jdbcTemplate" />
    		<property name="lobHandler">
    			<bean class="org.springframework.jdbc.support.lob.OracleLobHandler" >
    				<property name="nativeJdbcExtractor">
    					<ref local="nativeJdbcExtractor"/>
    				</property>
    				<property name="cache" value="false"/>
    			</bean>
    		</property>
    		<property name="storedProcedureFactory">
    			<ref local="databaseProgramFactory"/>
    		</property>
    	</bean>
    dao

    Code:
    XMLStoredProcedure xmlStoredProcedure = (XMLStoredProcedure)storedProcedure;
    					parameters.put(xmlStoredProcedure.getXmlParameterName(),new SqlLobValue("",this.lobHandler));
    					Map result = xmlStoredProcedure.execute(parameters);
    					CLOB xmlOut = (CLOB)result.get(xmlStoredProcedure.getXmlParameterName());
    					return xmlOut.characterStreamValue();
    NOTE: XMLStoredProcedure extends Spring StoredProcedure.
    The CLOB is declared as an in-out parameter

    I have the following error executing the stored procedure.

    Code:
    ERROR (OracleLobHandler.java:417) - Could not free Oracle LOB
    java.sql.SQLException: ORA-22922: nonexistent LOB value
    
    	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:283)
    	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
    	at oracle.jdbc.driver.T4C8TTILob.receiveReply(T4C8TTILob.java:930)
    	at oracle.jdbc.driver.T4C8TTILob.freeTemporaryLob(T4C8TTILob.java:411)
    	at oracle.jdbc.driver.T4CConnection.freeTemporary(T4CConnection.java:2877)
    	at oracle.sql.CLOB.freeTemporary(CLOB.java:815)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.close(OracleLobHandler.java:412)
    	at org.springframework.jdbc.core.support.SqlLobValue.cleanup(SqlLobValue.java:212)
    	at org.springframework.jdbc.core.StatementCreatorUtils.cleanupParameters(StatementCreatorUtils.java:380)
    	at org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.cleanupParameters(CallableStatementCreatorFactory.java:230)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:953)
    	at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:982)
    	at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:113)
    	at com.thomson.db.DatabaseStoredProcedure.execute(DatabaseStoredProcedure.java:30)
    	at com.thomson.db.dao.DDNDao.getXML(DDNDao.java:63)
    I'm using Spring Framework 2.5.2 and ojdbc14 (10.2.0.2).

    Does anybody knows which can be the cause of the above error?

  • #2
    try ORA-22922

    Comment


    • #3
      Of course I googled it before posting the question, but I didn't find anything related to my problem. All I know is that this error used to happen when the LOB value associated with the input locator does not exist and "Repopulate the locator by issuing a select statement and retry the operation" should resolve the problem, but I don't know how to do it with Spring and I can't find any information.
      Thanks in advance.

      Comment

      Working...
      X