• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

Hibernate, CLOBs, and ResultTransformers

Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 (http://javatechtricks.blogspot.com/2012/12/hibernate-clob-to-string-conversion.html) 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 " com.ibm.db2.jcc.a.SqlException: [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.
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic