ORA-22922:jboss 6 eap中不存在LOB值错误

时间:2014-03-25 12:54:46

标签: oracle jboss

在jboss 6 eap中存储clob值时会显示以下错误,但它在jboss 4.2中有效

引起:java.sql.SQLException:ORA-22922:不存在的LOB值

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3685)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1376)
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 38 more

1 个答案:

答案 0 :(得分:0)

检查你的代码没有提前松散的LOB定位器(没有/没有任何改变它你得到LOB定位器后):

SQL> create table t (x int, y clob);


SQL> declare
  2   l_y clob;
  3   buffer varchar2(10) := 'abcdef';
  4  begin
  5   -- You get clob locator
  6   insert into t values(1,empty_clob()) return y into l_y;
  7   -- you loose lob locator
  8   update t set y = empty_clob() where x = 1;
  9   -- you try to use lost locator
 10   dbms_lob.write(lob_loc => l_y, amount => 6, offset => 1, buffer => buffer );
 11  end;
 12  /
declare
*
error in line 1:
ORA-22922: nonexistent LOB value 
ORA-06512: in  "SYS.DBMS_LOB", line 1132 
ORA-06512: in  line 10