• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how hibernate stores object in a blob

Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my case Object is getting saved in a blob format but while we try to read and save that blob in a file it is not getting read giving EOFException and available() method of ObjectInputStream shows 0 that means there is nothing to be read . Then I checked in DB there was data in a blob format.
Can anyone help in in understanding that how hibernate stores an object in a blob format. What I analyzed is it is adding some special character while saving object in DB so that not able to convert byte to object format, as it is giving EOFException . The code I am writting is

ByteArrayInputStream bais;
ObjectInputStream in;
try {
bais = new ByteArrayInputStream(rcmCommunicationBean1);
in = new ObjectInputStream(bais);
ObjectStreamClass myObject = ObjectStreamClass.lookup(
Object obj = new Object();
while ((obj = in.readObject()) != null) {
if (obj instanceof RCMCommunicationBean) {
rcmCommunicationBean = (RCMCommunicationBean)obj;
} catch (IOException ex) {
} catch (ClassNotFoundException ex) {
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic