Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate, CLOBs, and ResultTransformers

Brian Mulholland
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a query with a bunch of joined tables, and have traditionally used the aliasToBean result transformer for such purposes. However, requirements recently had me stick a CLOB into this bean. I am mapping it to a String (though i also tried Object and that didn't work either). The error is:


I saw a post online ( about someone saying that Hibernate's result transformer chose not to work with CLOBs due to potential memory issue. But most of the time, my field really isn't going to be that large. Several Kb will be as large as it gets. He specced out a resulttransformer of his own to convert the clobs...but it doesn't work. It gives the error " [jcc][10120][11936][4.3.111] Invalid operation: Lob is closed. ERRORCODE=-4470, SQLSTATE=null" everytime i invoke getAsciiStream().

It appears that Hibernate already closed the result set or something at that point. How can I process CLOBs in my joined query that produces a hybrid bean not an entity mapped straight to the table.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!