-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: getCharacterStream clob API is throwing exception 3.6.10
PostPosted: Wed Nov 14, 2012 10:40 am 
Newbie

Joined: Wed Nov 14, 2012 8:05 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.