-->
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.  [ 2 posts ] 
Author Message
 Post subject: Clob problem
PostPosted: Tue Jul 11, 2006 10:47 am 
Newbie

Joined: Thu Sep 30, 2004 7:15 am
Posts: 1
Hi,
One of my table has a clob field.

I call this table to display the clob field in my jsp. I use the load method to load the class and it works fine for the first time.

try {
Transaction tx = hibSession.beginTransaction();

// Run query and populate a list

AddendumQuoteTcT aTcT = (AddendumQuoteTcT) hibSession.load(AddendumQuoteTcT.class, Integer.valueOf(id));

value = getValue(aTcT.getVerbiage());

tx.commit();
} catch (HibernateException he) {
// need more here.
he.printStackTrace();
}

I'm able to retrieve the clob here and using
BufferedReader br = new BufferedReader(clob.getCharacterStream());.

Now i try to call the same code above in my subsequent page, i get the following error.

ClobHelper:101 - [IBM][CLI Driver][DB2/6000] SQL0423N Locator variable "1" does not currently represent any value. SQLSTATE=0F001

Is that because the object is already loaded in the cache?

If yes how do i remove loaded object from cache. I tried using session.evit(), that didnt help.

Any suggestions?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 11, 2006 6:04 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
That looks like it's because of the standard JDBC driver issue that lobs are available only in the transaction that retrieved them from the DB. You need to read the lob in the initial transaction, and keep it around in some other member variable for use in other transactions. As the SQL error suggests, it's not an hibernate issue, just a shortcoming of the way that lobs are provided by the DB and driver.

_________________
Code tags are your friend. Know them and use them.


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

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.