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

156 views Asked by At

Am doing an update on scrollable result and its been working fine but after some time the scrollabe result became to return more results lets say more than 50 records and it became to show the below exeption am using the below code.

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)

How to solve this issue and why it happened?

1

There are 1 answers

0
shareef On BEST ANSWER

Well after try and rerun the code change i did to solve the issue is making the batch smaller ---> from

%10 to %5

but did not know why it happened if some one knows please improve my answer. the code became "working version"

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