-->
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 in Hibernate with ResultTransformer
PostPosted: Mon Mar 31, 2014 2:29 pm 
Newbie

Joined: Thu Nov 01, 2012 9:06 am
Posts: 3
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:

Code:
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) ~[?:1.6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[?:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:611) ~[?:1.6.0]
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:68) ~[hibernate-core-4.3.0.Final.jar:4.3.0.Final]
at org.hibernate.transform.AliasToBeanResultTransformer.transformTuple(AliasToBeanResultTransformer


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().

How can I make this work?


Top
 Profile  
 
 Post subject: Re: Clob in Hibernate with ResultTransformer
PostPosted: Thu Apr 03, 2014 9:44 am 
Newbie

Joined: Thu Nov 01, 2012 9:06 am
Posts: 3
*bump*

Anyone have advice on this? It's important to me because the issue is going to come up numerous times in our current project.


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.