Note that there are some explanatory texts on larger screens.

plurals
  1. POReading Clob object using getCharacterStream API causes "java.sql.SQLException: could not reset reader"
    text
    copied!<p>I am using Hibernate 3.6.10 version and trying to read a Clob data type after saving a record (Student). It is throwing error "could not reset reader"</p> <pre><code> public class Student implements java.io.Serializable { private long studentId; private String studentName; private Address studentAddress; private Clob searchProfileText; </code></pre> <p>While testing ... first I am saving a Student record then trying to get the searchProfileText from that record again as followiing</p> <pre><code>1 student1.setSearchProfileText(clob); 2 session.save(student1); 3 System.out.println("Reading Clob : " + student1.getSearchProfileText().getCharacterStream()); </code></pre> <p>Line number 3 , I am getting following exception</p> <pre><code>java.sql.SQLException: could not reset reader at org.hibernate.engine.jdbc.ClobProxy.resetIfNeeded(ClobProxy.java:178) </code></pre> <p>I tried <code>session.flush();</code> and then reload the data using following code, still same error: </p> <pre><code>session.flush(); session.get(Student.class, student1.getStudentId()); System.out.println("Reading Clob : " + student1.getSearchProfileText().getCharacterStream()); </code></pre> <p>OBSERVATION 2:</p> <p>Even if I fetch a record containing CLOB data using Hibernate criteria and put a restriction against the CLOB column, I can't access CLOB data after fetching the record. I think, it is a BUG in 3.6.10 Final !!!</p> <p>Please help to get rid of this error.. I have tried all related topics on this but no success yet :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload