ORA-03106:批量更新中出现致命的双任务通信协议错误



我有一个合并查询,其中一列的类型为 CLOB

PreparedStatement pstmt = conn.prepareStatement("MERGE..");    
for(List) {
//Update part
...
ByteArrayInputStream inputStream2 = new ByteArrayInputStream(model.getDescription().getBytes());
InputStreamReader inputStreamReader2 = new InputStreamReader(inputStream2);
pstmt.setClob(i++, inputStreamReader2); 
//Insert
..
ByteArrayInputStream inputStream = new ByteArrayInputStream(model.getDescription().getBytes());
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
pstmt.setClob(i++, inputStreamReader);  
pstmt.addbatch() 
}
pstmt.executeBatch();

它在 executeBatch 行上给了我java.sql.BatchUpdateException: ORA-03106: fatal two-task communication protocol错误,但是当我刚刚设置 pstmt.setString(i++, "( 时它可以工作,这意味着由于这 2 个 CLOB 设置而导致此异常。我犯了什么错误?

我使用 clob = conn.createClob(( 解决了这个问题;不知道为什么我以前没有使用它。

最新更新