Case 1 ============= We are using Hibernate 3.6.10.Final version and trying to read a Clob data type after saving a record (Student). It is throwing error "could not reset reader"
public class Student implements java.io.Serializable {
private long studentId; private String studentName; private Address studentAddress; private Clob searchProfileText;
While testing ... first we are saving a Student record then trying to get the searchProfileText from that record again as followiing student1.setSearchProfileText(clob); session.save(student1); System.out.println("Reading Clob :: " + student1.getSearchProfileText().getCharacterStream());
Line number 3 , we are getting following exception
java.sql.SQLException: could not reset reader at org.hibernate.engine.jdbc.ClobProxy.resetIfNeeded(ClobProxy.java:178)
We tried session.flush(); and then reload the data using following code, still same error.
session.flush(); session.get(Student.class, student1.getStudentId()); System.out.println("Reading Clob :: " + student1.getSearchProfileText().getCharacterStream());
Case 2: ========
When we fetch a record containing CLOB data using Hibernate criteria and put a restriction against the CLOB column, we can't access CLOB data after fetching the record - it is throwing the same exception. if (Utility.isNotEmpty(vText)) { brStrLnkCrit.add(Restrictions.like("BR.XXRecDetailText", session.getLobHelper().createClob(vText)));
Can anyone help on this, this issue has become very critical for us.
|