• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing Clob in CMP EJB

 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to retrieve CLOB through CMP in Websphere.
I get the below exception when I try to get the localInterface which contains CLOB field in my facade by using the findByPrimary Key method.
java.lang.RuntimeException: InputStream does not contain a serialized object
at com.ibm.vap.converters.streams.VapBinaryStreamToSerializableObjectConverter.objectFrom(VapBinaryStreamToSerializableObjectConverter.java:57)
I am wondering if it is possible getting Clob through CMP in EJB.
BTW I have tried using both String and CLOB as CMP field types matching to CLOB in Oracle DB.

Thanks....
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to change the converter that is in use on this field. The error is telling you that this CLOB does not contain a serialized object -- which from what you're telling us is right.
Go to the properties view of the mapping editor (down at the bottom of the page) and try changing the converter (under "transformation") to a "VapBinaryStreamtoByteArrayConverter", and then change the field type you are mapping it to to a ByteArray if you want to treat it as a byte array.
If you wanted to treat it as a String, try changing the field type to String and using a "VapAsciiStreamtoStringConverter".
The hows and whys of converters are covered in the Advanced EJB mapping chapter of my book, by the way...
Kyle
 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the solution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!