-->
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.  [ 4 posts ] 
Author Message
 Post subject: PostgreSQL and Hibernate BLOB truncation problem
PostPosted: Sun Apr 13, 2008 8:22 am 
Newbie

Joined: Mon Apr 16, 2007 2:16 pm
Posts: 3
Hello All!

I created entity with 2 BLOB columns in one table: one for image and one for thumbnail. Storing image and getting it back in another session works pretty good.

But when I set thumbnail BLOB successfully, the original BLOB becomes empty. Retrieved entity returns length 0 for image BLOB.

@Lob private Blob image;
@Lob private Blob thumbnail;

Hibernate 3.2.6, Annotations 3.3.0, PostgreSQL 8.3.1, JDBC 8.3-603.
The problem is 100% reproducible. Please, help?


Top
 Profile  
 
 Post subject: P. S.
PostPosted: Sun Apr 13, 2008 8:50 am 
Newbie

Joined: Mon Apr 16, 2007 2:16 pm
Posts: 3
P.S. The same code works fine on Derby, H2, MySQL and MS SQL.


Top
 Profile  
 
 Post subject: New info available
PostPosted: Sun Apr 13, 2008 11:47 am 
Newbie

Joined: Mon Apr 16, 2007 2:16 pm
Posts: 3
It looks like raw JDBC access to created table works fine.

Tracing in debugger shows that during Session.flash UPDATE "image" column OID (BLOB reference) is changed to another (e.g. was 85781, became 85782), but blob data can still be referenced by old OID.


Top
 Profile  
 
 Post subject: Re: New info available
PostPosted: Thu Jul 01, 2010 6:27 pm 
Beginner
Beginner

Joined: Mon Jun 28, 2010 1:02 pm
Posts: 21
smironov wrote:
It looks like raw JDBC access to created table works fine.

Tracing in debugger shows that during Session.flash UPDATE "image" column OID (BLOB reference) is changed to another (e.g. was 85781, became 85782), but blob data can still be referenced by old OID.


You might have to define a trigger for update/delete. I'm not an expert, but search for "lo_manage" function and "trigger" keywords on the web to get more info on that.
Here's my problem though:
https://forum.hibernate.org/viewtopic.php?f=1&t=1005584


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.