休眠批量更新 java.sql.BatchUpdateException Ora-24813 cab=nnot 发送或接收不受支持的 LOB

Hibernate Batch update java.sql.BatchUpdateException Ora-24813 cab=nnot send or receive an unsupported LOB

我正在对可滚动结果进行更新并且它工作正常但是一段时间后滚动结果变成了return更多的结果可以说超过 50 条记录并且它变成了显示下面的异常我正在使用下面的代码。

ScrollableResults serviceScroll = session.createCriteria(SomeService.class).add(Restrictions.in("some values", arraylistofvalues)).scroll();

int count_cursor = 0;

while (serviceScroll.next()) {
                        SomeService serviceRecord = (SomeService) serviceScroll.get(0);

    //some updates here

     session.update(CenterServiceRecord);

                        someEntity test = new someEntity();

                        someEntity.setStatusDate(new Date());

                        session.save(someEntity);
                        session.flush();
                        if (++count_cursor % 10 == 0) {
                            session.flush();
                            session.clear();
                        }
    }



Caused by: java.sql.BatchUpdateException: ORA-24813: cannot send or receive an unsupported LOB

        at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
        at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
        at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)

如何解决这个问题,为什么会这样?

好吧,在尝试重新运行代码更改后,我为解决问题所做的是使批次变小 ---> 来自

%10 to %5

但不知道为什么会这样,如果有人知道请改进我的答案。 代码变成了“工作版本

if (++count_cursor % 5 == 0) {
      session.flush();
      session.clear();
  }